Skip to content

Commit 909111b

Browse files
Zhen Leijoergroedel
authored andcommitted
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 <thunder.leizhen@huawei.com> Reviewed-by: Robin Murphy <robin.murphy@arm.com> Signed-off-by: Joerg Roedel <jroedel@suse.de>
1 parent a1831bb commit 909111b

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

drivers/iommu/iommu.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1869,13 +1869,14 @@ int iommu_fwspec_add_ids(struct device *dev, u32 *ids, int num_ids)
18691869
fwspec = krealloc(dev->iommu_fwspec, size, GFP_KERNEL);
18701870
if (!fwspec)
18711871
return -ENOMEM;
1872+
1873+
dev->iommu_fwspec = fwspec;
18721874
}
18731875

18741876
for (i = 0; i < num_ids; i++)
18751877
fwspec->ids[fwspec->num_ids + i] = ids[i];
18761878

18771879
fwspec->num_ids += num_ids;
1878-
dev->iommu_fwspec = fwspec;
18791880
return 0;
18801881
}
18811882
EXPORT_SYMBOL_GPL(iommu_fwspec_add_ids);

0 commit comments

Comments
 (0)