From: Zhen Lei Date: Fri, 3 Feb 2017 09:35:02 +0000 (+0800) Subject: iommu: Avoid unnecessary assignment of dev->iommu_fwspec X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=909111ba0ba6aa228d9b6e9cf01dd68a46586cb4;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git iommu: Avoid unnecessary assignment of dev->iommu_fwspec Move the assignment statement into if branch above, where it only needs to be. Signed-off-by: Zhen Lei Reviewed-by: Robin Murphy Signed-off-by: Joerg Roedel --- diff --git a/drivers/iommu/iommu.c b/drivers/iommu/iommu.c index f4a176e56e39..428455a21ee7 100644 --- a/drivers/iommu/iommu.c +++ b/drivers/iommu/iommu.c @@ -1869,13 +1869,14 @@ int iommu_fwspec_add_ids(struct device *dev, u32 *ids, int num_ids) fwspec = krealloc(dev->iommu_fwspec, size, GFP_KERNEL); if (!fwspec) return -ENOMEM; + + dev->iommu_fwspec = fwspec; } for (i = 0; i < num_ids; i++) fwspec->ids[fwspec->num_ids + i] = ids[i]; fwspec->num_ids += num_ids; - dev->iommu_fwspec = fwspec; return 0; } EXPORT_SYMBOL_GPL(iommu_fwspec_add_ids);