Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b1e2afca authored by Shawn Lin's avatar Shawn Lin Committed by Joerg Roedel
Browse files

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: default avatarShawn Lin <shawn.lin@rock-chips.com>
Signed-off-by: default avatarJoerg Roedel <jroedel@suse.de>
parent c6935931
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -636,7 +636,7 @@ static int ipmmu_add_device(struct device *dev)
	spin_unlock(&ipmmu_devices_lock);
	spin_unlock(&ipmmu_devices_lock);


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


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