소스 검색

msm: ipa3: Fix null pointer dereference error

If smmu is not enabled, smmu context device check
was missing before accessing it which was resulting
in null pointer dereference. Now adding check
before accessing it.

Change-Id: I94393524c79847a165ba605d34906525640b359a
Signed-off-by: Piyush Dhyani <[email protected]>
Piyush Dhyani 4 년 전
부모
커밋
6da4954462
1개의 변경된 파일1개의 추가작업 그리고 1개의 파일을 삭제
  1. 1 1
      drivers/platform/msm/ipa/ipa_v3/ipa_nat.c

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

@@ -150,7 +150,7 @@ static int ipa3_nat_ipv6ct_mmap(
 	/*
 	 * Check if no smmu or non dma coherent
 	 */
-	if (cb && (!cb->valid || !dev_is_dma_coherent(cb->dev))) {
+	if (cb && cb->dev && (!cb->valid || !dev_is_dma_coherent(cb->dev))) {
 
 		IPADBG("Either smmu valid=%u and/or DMA coherent=%u false\n",
 			   cb->valid, !dev_is_dma_coherent(cb->dev));