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

Commit 35d87707 authored by Mitchel Humpherys's avatar Mitchel Humpherys
Browse files

firmware: qcom: tz_log: add error checking for ion_map_kernel



ion_map_kernel can return an ERR_PTR but we're currently assuming that
it always returns a valid pointer. Fix this by checking for IS_ERR
before dereferencing the pointer.

Change-Id: I2f606c042ad8c8ff6bc8db6501eed0a0924290fb
Signed-off-by: default avatarMitchel Humpherys <mitchelh@codeaurora.org>
parent e33b9fba
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -614,6 +614,13 @@ static void tzdbg_register_qsee_log_buf(void)

	g_qsee_log =
		(struct tzdbg_log_t *)ion_map_kernel(g_ion_clnt, g_ihandle);

	if (IS_ERR(g_qsee_log)) {
		pr_err("%s: Couldn't map ion buffer to kernel\n",
			__func__);
		goto err2;
	}

	g_qsee_log->log_pos.wrap = g_qsee_log->log_pos.offset = 0;
	return;