path: root/drivers/iommu
diff options
authorDan Carpenter <>2021-05-19 09:50:26 +0800
committerJoerg Roedel <>2021-05-19 08:51:02 +0200
commit1a590a1c8bf46bf80ea12b657ca44c345531ac80 (patch)
treef125a4f935df8b6c8d6a55f44eb879754612abdd /drivers/iommu
parent382d91fc0f4f1b13f8a0dcbf7145f4f175b71a18 (diff)
iommu/vt-d: Check for allocation failure in aux_detach_device()
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 <> Acked-by: Lu Baolu <> Link: Link: Signed-off-by: Joerg Roedel <>
Diffstat (limited to 'drivers/iommu')
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/iommu/intel/iommu.c b/drivers/iommu/intel/iommu.c
index 708f430af1c4..9a7b79b5af18 100644
--- 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);