mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2024-11-24 17:20:50 +07:00
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>
This commit is contained in:
parent
c6935931c1
commit
b1e2afca63
@ -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) {
|
||||
|
Loading…
Reference in New Issue
Block a user