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

Commit f5cd7c13 authored by Laura Abbott's avatar Laura Abbott
Browse files

msm: iommu: Check for NULL genpools during domain teardown



During domain creation, some of the genpools will be set to NULL if
there is not enough memory for creation. Check for these NULL
genpools during domain destruction to avoid NULL dereferences.

Change-Id: I60238c138b809ef5c13383f5b1752ab6c799707d
CRs-Fixed: 573612
Signed-off-by: default avatarLaura Abbott <lauraa@codeaurora.org>
parent b5b762bb
Loading
Loading
Loading
Loading
+2 −1
Original line number Original line Diff line number Diff line
@@ -553,6 +553,7 @@ int msm_unregister_domain(struct iommu_domain *domain)
	ida_simple_remove(&domain_nums, data->domain_num);
	ida_simple_remove(&domain_nums, data->domain_num);


	for (i = 0; i < data->npools; ++i)
	for (i = 0; i < data->npools; ++i)
		if (data->pools[i].gpool)
			gen_pool_destroy(data->pools[i].gpool);
			gen_pool_destroy(data->pools[i].gpool);


	kfree(data->pools);
	kfree(data->pools);