Răsfoiți Sursa

msm: ipa: Break from loop when icc_path is error

If of_icc_get returns with error code, then invoking
icc_put in fail_bus_reg segment, warn_on() logs will be
printed, break from the loop to avoid invoking icc_put.

Signed-off-by: Cheng Zeng <quic_chenzeng@quicinc.com>
Cheng Zeng 3 ani în urmă
părinte
comite
41606154a3
1 a modificat fișierele cu 4 adăugiri și 1 ștergeri
  1. 4 1
      drivers/platform/msm/ipa/ipa_v3/ipa.c

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

@@ -9287,7 +9287,10 @@ fail_init_active_client:
 	ipa3_clk = NULL;
 fail_bus_reg:
 	for (i = 0; i < ipa3_ctx->icc_num_paths; i++)
-		if (ipa3_ctx->ctrl->icc_path[i]) {
+		if (IS_ERR_OR_NULL(ipa3_ctx->ctrl->icc_path[i])) {
+			ipa3_ctx->ctrl->icc_path[i] = NULL;
+			break;
+		} else {
 			icc_put(ipa3_ctx->ctrl->icc_path[i]);
 			ipa3_ctx->ctrl->icc_path[i] = NULL;
 		}