Browse Source

msm: ipa: make sure ipa context exists when 11ad smmu prob

make sure ipa3_ctx is not NULL when smmu is being probed
for 11ad device

Signed-off-by: Ghanim Fodi <[email protected]>
Ghanim Fodi 5 years ago
parent
commit
ef8de8d9db
1 changed files with 4 additions and 0 deletions
  1. 4 0
      ipa/ipa_v3/ipa.c

+ 4 - 0
ipa/ipa_v3/ipa.c

@@ -7702,6 +7702,10 @@ int ipa3_plat_drv_probe(struct platform_device *pdev_p,
 	}
 
 	if (of_device_is_compatible(dev->of_node, "qcom,ipa-smmu-11ad-cb")) {
+		if (ipa3_ctx == NULL) {
+			IPAERR("ipa3_ctx was not initialized\n");
+			return -EPROBE_DEFER;
+		}
 		cb = ipa3_get_smmu_ctx(IPA_SMMU_CB_11AD);
 		cb->dev = dev;
 		smmu_info.present[IPA_SMMU_CB_11AD] = true;