소스 검색

ipa: Fix HPC KW static analysis error

The static analysis reported potential null pointer dereference
in the __ipa_add_hpc_hdr_insertion(), which is caused by potential
null pointer returned by the ipa3_id_find().
In fact the ipa3_id_find() may only return null, if the radix tree
was destroyed after a failure in the ipa3_pre_init(). But in this
case, the whole driver will fail much earlier.

Change-Id: I1a3ed08ba59c2efa9c2c5a9f9da97c4218ab9129
Signed-off-by: Ilia Lin <[email protected]>
Ilia Lin 3 년 전
부모
커밋
a1c2b8ad51
1개의 변경된 파일1개의 추가작업 그리고 8개의 파일을 삭제
  1. 1 8
      drivers/platform/msm/ipa/ipa_v3/ipa_hdr.c

+ 1 - 8
drivers/platform/msm/ipa/ipa_v3/ipa_hdr.c

@@ -740,17 +740,10 @@ static int __ipa_add_hpc_hdr_insertion(struct ipa_hdr_add *hdr, bool user)
 		IPAERR("failed to add hdr proc ctx\n");
 		goto fail_add_proc_ctx;
 	}
-	entry->proc_ctx = (struct ipa3_hdr_proc_ctx_entry *)
-		ipa3_id_find(proc_ctx.proc_ctx_hdl);
-	if (!entry->proc_ctx) {
-		IPAERR_RL("ipa3_id_find failed\n");
-		goto fail_id_find;
-	}
+	entry->proc_ctx = (struct ipa3_hdr_proc_ctx_entry *)ipa3_id_find(proc_ctx.proc_ctx_hdl);
 
 	return 0;
 
-fail_id_find:
-	__ipa3_del_hdr_proc_ctx(entry->proc_ctx->id, true, user);
 fail_add_proc_ctx:
 	__ipa3_del_hdr(hdr->hdr_hdl, user);
 error: