projects
/
linux.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
382d91f
)
iommu/vt-d: Check for allocation failure in aux_detach_device()
author
Dan Carpenter
<dan.carpenter@oracle.com>
Wed, 19 May 2021 01:50:26 +0000
(09:50 +0800)
committer
Joerg Roedel
<jroedel@suse.de>
Wed, 19 May 2021 06:51:02 +0000
(08:51 +0200)
In current kernels small allocations never fail, but checking for
allocation failure is the correct thing to do.
Fixes: 18abda7a2d55 ("iommu/vt-d: Fix general protection fault in aux_detach_device()")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Acked-by: Lu Baolu <baolu.lu@linux.intel.com>
Link:
https://lore.kernel.org/r/YJuobKuSn81dOPLd@mwanda
Link:
https://lore.kernel.org/r/20210519015027.108468-2-baolu.lu@linux.intel.com
Signed-off-by: Joerg Roedel <jroedel@suse.de>
drivers/iommu/intel/iommu.c
patch
|
blob
|
history
diff --git
a/drivers/iommu/intel/iommu.c
b/drivers/iommu/intel/iommu.c
index 708f430af1c4403662245c08530dbab79c83f078..9a7b79b5af183e8971d4385c3a9667ed01e364a6 100644
(file)
--- a/
drivers/iommu/intel/iommu.c
+++ b/
drivers/iommu/intel/iommu.c
@@
-4606,6
+4606,8
@@
static int auxiliary_link_device(struct dmar_domain *domain,
if (!sinfo) {
sinfo = kzalloc(sizeof(*sinfo), GFP_ATOMIC);
+ if (!sinfo)
+ return -ENOMEM;
sinfo->domain = domain;
sinfo->pdev = dev;
list_add(&sinfo->link_phys, &info->subdevices);