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

Commit f8ac0fb5 authored by Patrick Daly's avatar Patrick Daly
Browse files

iommu: arm-smmu: Fix list iteration error



After using list_for_each_entry, the iterator variable is set to the
head of the list even if the list is empty. Check for this and
return NULL in this case.

Change-Id: Ibd931f2353dee705b6be857e53854f1299219016
Signed-off-by: default avatarPatrick Daly <pdaly@codeaurora.org>
parent e15b3bc7
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -4124,10 +4124,10 @@ static struct qsmmuv500_tbu_device *qsmmuv500_find_tbu(
	list_for_each_entry(tbu, &data->tbus, list) {
		if (tbu->sid_start <= sid &&
		    sid < tbu->sid_start + tbu->num_sids)
			break;
	}
			return tbu;
	}
	return NULL;
}

static void qsmmuv500_device_reset(struct arm_smmu_device *smmu)
{