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

Commit 8799b3ea authored by Pooja Kumari's avatar Pooja Kumari
Browse files

ipa3: validate ipahal_ctx before use



Add check to validate ipahal_ctx before dereference
to avoid NULL pointer dereference error.

Change-Id: Id07ab470629c09a9a9d96f874cb0147cd71e4976
Signed-off-by: default avatarPooja Kumari <kumarip@codeaurora.org>
parent 91a4f94a
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -3751,6 +3751,12 @@ u32 ipahal_get_reg_mn_ofst(enum ipahal_reg_name reg, u32 m, u32 n)
		return -EINVAL;
	}

	if (!ipahal_ctx) {
		IPAHAL_ERR_RL("ipahal_ctx is NULL\n");
		WARN_ON_RATELIMIT_IPA(1);
		return -EINVAL;
	}

	IPAHAL_DBG_LOW("get offset of %s m=%u n=%u\n",
		ipahal_reg_name_str(reg), m, n);
	offset = ipahal_reg_objs[ipahal_ctx->hw_type][reg].offset;