diff options
author | Shawn Lin <shawn.lin@rock-chips.com> | 2016-08-24 10:23:51 +0800 |
---|---|---|
committer | Joerg Roedel <jroedel@suse.de> | 2016-09-05 12:53:58 +0200 |
commit | b1e2afca635bb01f93ecd8112c265b980f1abc08 (patch) | |
tree | 8bc0ef383737b5711dc9fc6385548f2a10c49ad3 /drivers/iommu/ipmmu-vmsa.c | |
parent | c6935931c1894ff857616ff8549b61236a19148f (diff) | |
download | talos-obmc-linux-b1e2afca635bb01f93ecd8112c265b980f1abc08.tar.gz talos-obmc-linux-b1e2afca635bb01f93ecd8112c265b980f1abc08.zip |
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>
Diffstat (limited to 'drivers/iommu/ipmmu-vmsa.c')
-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) 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) { |