Explorar o código

msm: ipa: Set the logbuf to NULL after kfree

Set the ipa3_ctx->logbuf to NULL after freeing it,
IPA logging API will use the ipa3_ctx->logbuf after
freeing it, that can make crash.

Signed-off-by: Cheng Zeng <[email protected]>
Cheng Zeng %!s(int64=3) %!d(string=hai) anos
pai
achega
08bd5f130e
Modificáronse 1 ficheiros con 3 adicións e 1 borrados
  1. 3 1
      drivers/platform/msm/ipa/ipa_v3/ipa.c

+ 3 - 1
drivers/platform/msm/ipa/ipa_v3/ipa.c

@@ -9299,8 +9299,10 @@ fail_mem_ctrl:
 	kfree(ipa3_ctx->ipa_tz_unlock_reg);
 	ipa3_ctx->ipa_tz_unlock_reg = NULL;
 fail_tz_unlock_reg:
-	if (ipa3_ctx->logbuf)
+	if (ipa3_ctx->logbuf) {
 		ipc_log_context_destroy(ipa3_ctx->logbuf);
+		ipa3_ctx->logbuf = NULL;
+	}
 fail_uc_file_alloc:
 	kfree(ipa3_ctx->gsi_fw_file_name);
 	ipa3_ctx->gsi_fw_file_name = NULL;