From 41606154a33c6119704cb7a68178bd22665cd165 Mon Sep 17 00:00:00 2001 From: Cheng Zeng Date: Thu, 20 Jan 2022 17:13:33 +0800 Subject: [PATCH] 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 --- drivers/platform/msm/ipa/ipa_v3/ipa.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/platform/msm/ipa/ipa_v3/ipa.c b/drivers/platform/msm/ipa/ipa_v3/ipa.c index 06bf6fb96d..70cf8c6eab 100644 --- a/drivers/platform/msm/ipa/ipa_v3/ipa.c +++ b/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; }