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

Commit 545e03e8 authored by Mohammed Javid's avatar Mohammed Javid
Browse files

msm: ipa4: Fix dangling pointer dereferencing after NAT del cmd



Once after the dma free, assign the pointer with
NULL and reset mem allocated flag, to avoid
dangling pointer dereferencing.

Change-Id: I74a2c2b0589a576de7946e4e2244c7ef5cca975f
Signed-off-by: default avatarMohammed Javid <mjavid@codeaurora.org>
parent 7d7c5b26
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -1516,6 +1516,8 @@ int ipa3_del_nat_table(struct ipa_ioc_nat_ipv6ct_table_del *del)
			ipa3_ctx->nat_mem.pdn_mem.size,
			ipa3_ctx->nat_mem.pdn_mem.base,
			ipa3_ctx->nat_mem.pdn_mem.phys_base);
		ipa3_ctx->nat_mem.pdn_mem.base = NULL;
		ipa3_ctx->nat_mem.dev.is_mem_allocated = false;
	}

	ipa3_nat_ipv6ct_free_mem(&ipa3_ctx->nat_mem.dev);