From: cgel.zte@gmail.com To: robdclark@gmail.com, sean@poorly.run Cc: architt@codeaurora.org, linux-kernel@vger.kernel.org, ryadav@codeaurora.org, airlied@linux.ie, linux-arm-msm@vger.kernel.org, Lv Ruyi <lv.ruyi@zte.com.cn>, quic_abhinavk@quicinc.com, dri-devel@lists.freedesktop.org, bjorn.andersson@linaro.org, tiny.windzz@gmail.com, angelogioacchino.delregno@somainline.org, dmitry.baryshkov@linaro.org, jsanka@codeaurora.org, swboyd@chromium.org, freedreno@lists.freedesktop.org, Zeal Robot <zealci@zte.com.cn>, skolluku@codeaurora.org Subject: [PATCH] drm/msm/dpu: fix error check return value of irq_of_parse_and_map() Date: Mon, 25 Apr 2022 09:09:47 +0000 [thread overview] Message-ID: <20220425090947.3498897-1-lv.ruyi@zte.com.cn> (raw) From: Lv Ruyi <lv.ruyi@zte.com.cn> The irq_of_parse_and_map() function returns 0 on failure, and does not return a negative value anyhow, so never enter this conditional branch. Fixes: 25fdd5933e4c ("drm/msm: Add SDM845 DPU support") Reported-by: Zeal Robot <zealci@zte.com.cn> Signed-off-by: Lv Ruyi <lv.ruyi@zte.com.cn> --- drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c index e29796c4f27b..36eeeae7fe45 100644 --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c @@ -1187,9 +1187,9 @@ struct msm_kms *dpu_kms_init(struct drm_device *dev) dpu_kms = to_dpu_kms(priv->kms); irq = irq_of_parse_and_map(dpu_kms->pdev->dev.of_node, 0); - if (irq < 0) { - DPU_ERROR("failed to get irq: %d\n", irq); - return ERR_PTR(irq); + if (!irq) { + DPU_ERROR("failed to get irq\n"); + return ERR_PTR(-EINVAL); } dpu_kms->base.irq = irq; -- 2.25.1
WARNING: multiple messages have this Message-ID (diff)
From: cgel.zte@gmail.com To: robdclark@gmail.com, sean@poorly.run Cc: quic_abhinavk@quicinc.com, airlied@linux.ie, daniel@ffwll.ch, dmitry.baryshkov@linaro.org, swboyd@chromium.org, bjorn.andersson@linaro.org, angelogioacchino.delregno@somainline.org, tiny.windzz@gmail.com, architt@codeaurora.org, jsanka@codeaurora.org, skolluku@codeaurora.org, ryadav@codeaurora.org, linux-arm-msm@vger.kernel.org, dri-devel@lists.freedesktop.org, freedreno@lists.freedesktop.org, linux-kernel@vger.kernel.org, Lv Ruyi <lv.ruyi@zte.com.cn>, Zeal Robot <zealci@zte.com.cn> Subject: [PATCH] drm/msm/dpu: fix error check return value of irq_of_parse_and_map() Date: Mon, 25 Apr 2022 09:09:47 +0000 [thread overview] Message-ID: <20220425090947.3498897-1-lv.ruyi@zte.com.cn> (raw) From: Lv Ruyi <lv.ruyi@zte.com.cn> The irq_of_parse_and_map() function returns 0 on failure, and does not return a negative value anyhow, so never enter this conditional branch. Fixes: 25fdd5933e4c ("drm/msm: Add SDM845 DPU support") Reported-by: Zeal Robot <zealci@zte.com.cn> Signed-off-by: Lv Ruyi <lv.ruyi@zte.com.cn> --- drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c index e29796c4f27b..36eeeae7fe45 100644 --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c @@ -1187,9 +1187,9 @@ struct msm_kms *dpu_kms_init(struct drm_device *dev) dpu_kms = to_dpu_kms(priv->kms); irq = irq_of_parse_and_map(dpu_kms->pdev->dev.of_node, 0); - if (irq < 0) { - DPU_ERROR("failed to get irq: %d\n", irq); - return ERR_PTR(irq); + if (!irq) { + DPU_ERROR("failed to get irq\n"); + return ERR_PTR(-EINVAL); } dpu_kms->base.irq = irq; -- 2.25.1
next reply other threads:[~2022-04-25 9:10 UTC|newest] Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top 2022-04-25 9:09 cgel.zte [this message] 2022-04-25 9:09 ` [PATCH] drm/msm/dpu: fix error check return value of irq_of_parse_and_map() cgel.zte 2022-04-25 20:10 ` Stephen Boyd 2022-04-25 20:10 ` Stephen Boyd 2022-04-25 21:08 ` Dmitry Baryshkov 2022-04-25 21:08 ` Dmitry Baryshkov
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20220425090947.3498897-1-lv.ruyi@zte.com.cn \ --to=cgel.zte@gmail.com \ --cc=airlied@linux.ie \ --cc=angelogioacchino.delregno@somainline.org \ --cc=architt@codeaurora.org \ --cc=bjorn.andersson@linaro.org \ --cc=dmitry.baryshkov@linaro.org \ --cc=dri-devel@lists.freedesktop.org \ --cc=freedreno@lists.freedesktop.org \ --cc=jsanka@codeaurora.org \ --cc=linux-arm-msm@vger.kernel.org \ --cc=linux-kernel@vger.kernel.org \ --cc=lv.ruyi@zte.com.cn \ --cc=quic_abhinavk@quicinc.com \ --cc=robdclark@gmail.com \ --cc=ryadav@codeaurora.org \ --cc=sean@poorly.run \ --cc=skolluku@codeaurora.org \ --cc=swboyd@chromium.org \ --cc=tiny.windzz@gmail.com \ --cc=zealci@zte.com.cn \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.