Skip to content

Commit

Permalink
iommu/ipmmu-vmsa: Fix wrong error handle of ipmmu_add_device
Browse files Browse the repository at this point in the history
Let's fix the error handle of ipmmu_add_device
when failing to find utlbs, otherwise we take a
risk of pontential memleak.

Signed-off-by: Shawn Lin <shawn.lin@rock-chips.com>
Signed-off-by: Joerg Roedel <jroedel@suse.de>
  • Loading branch information
Shawn Lin authored and Joerg Roedel committed Sep 5, 2016
1 parent c693593 commit b1e2afc
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/iommu/ipmmu-vmsa.c
Original file line number Diff line number Diff line change
Expand Up @@ -636,7 +636,7 @@ static int ipmmu_add_device(struct device *dev)
spin_unlock(&ipmmu_devices_lock);

if (ret < 0)
return -ENODEV;
goto error;

for (i = 0; i < num_utlbs; ++i) {
if (utlbs[i] >= mmu->num_utlbs) {
Expand Down

0 comments on commit b1e2afc

Please sign in to comment.