diff options
author | Shawn Lin <shawn.lin@rock-chips.com> | 2016-08-23 22:23:51 -0400 |
---|---|---|
committer | Joerg Roedel <jroedel@suse.de> | 2016-09-05 06:53:58 -0400 |
commit | b1e2afca635bb01f93ecd8112c265b980f1abc08 (patch) | |
tree | 8bc0ef383737b5711dc9fc6385548f2a10c49ad3 | |
parent | c6935931c1894ff857616ff8549b61236a19148f (diff) |
iommu/ipmmu-vmsa: Fix wrong error handle of ipmmu_add_device
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>
-rw-r--r-- | drivers/iommu/ipmmu-vmsa.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/iommu/ipmmu-vmsa.c b/drivers/iommu/ipmmu-vmsa.c index 2fdbac67a77f..ace331da6459 100644 --- a/drivers/iommu/ipmmu-vmsa.c +++ b/drivers/iommu/ipmmu-vmsa.c | |||
@@ -636,7 +636,7 @@ static int ipmmu_add_device(struct device *dev) | |||
636 | spin_unlock(&ipmmu_devices_lock); | 636 | spin_unlock(&ipmmu_devices_lock); |
637 | 637 | ||
638 | if (ret < 0) | 638 | if (ret < 0) |
639 | return -ENODEV; | 639 | goto error; |
640 | 640 | ||
641 | for (i = 0; i < num_utlbs; ++i) { | 641 | for (i = 0; i < num_utlbs; ++i) { |
642 | if (utlbs[i] >= mmu->num_utlbs) { | 642 | if (utlbs[i] >= mmu->num_utlbs) { |