Explorar o código

msm: ipa: Avoid buffer over read of smmu ctx

To avoid the the smmu cb ctx read if smmu is bypassed.

Change-Id: I0b23d413365d9b36cdf560605c9c221f155624cb
Signed-off-by: Michael Adisumarta <[email protected]>
Michael Adisumarta %!s(int64=4) %!d(string=hai) anos
pai
achega
d069ef5432
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      drivers/platform/msm/ipa/ipa_v3/ipa_nat.c

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

@@ -145,7 +145,7 @@ static int ipa3_nat_ipv6ct_mmap(
 	/*
 	 * Check if no smmu or non dma coherent
 	 */
-	if (!cb->valid || !dev_is_dma_coherent(cb->dev)) {
+	if (cb && (!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));