From: cgel.zte@gmail.com To: dmitry.baryshkov@linaro.org Cc: sean@poorly.run, quic_abhinavk@quicinc.com, airlied@linux.ie, cgel.zte@gmail.com, lv.ruyi@zte.com.cn, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, bjorn.andersson@linaro.org, linux-arm-msm@vger.kernel.org, swboyd@chromium.org, quic_khsieh@quicinc.com, freedreno@lists.freedesktop.org, Zeal Robot <zealci@zte.com.cn>, linux@roeck-us.net Subject: [PATCH v2] drm/msm/dp: fix error check return value of irq_of_parse_and_map() Date: Sun, 24 Apr 2022 03:24:18 +0000 [thread overview] Message-ID: <20220424032418.3173632-1-lv.ruyi@zte.com.cn> (raw) In-Reply-To: <0e6028f6-3fc1-2a27-0a45-0e024c632248@linaro.org> From: Lv Ruyi <lv.ruyi@zte.com.cn> The irq_of_parse_and_map() function returns 0 on failure, and does not return an negative value. Fixes: 8ede2ecc3e5e ("drm/msm/dp: Add DP compliance tests on Snapdragon Chipsets") Reported-by: Zeal Robot <zealci@zte.com.cn> Signed-off-by: Lv Ruyi <lv.ruyi@zte.com.cn> --- v2: don't print rc, and return -EINVAL rather than 0 --- drivers/gpu/drm/msm/dp/dp_display.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/msm/dp/dp_display.c b/drivers/gpu/drm/msm/dp/dp_display.c index a42732b67349..c3566e6564b1 100644 --- a/drivers/gpu/drm/msm/dp/dp_display.c +++ b/drivers/gpu/drm/msm/dp/dp_display.c @@ -1239,10 +1239,9 @@ int dp_display_request_irq(struct msm_dp *dp_display) dp = container_of(dp_display, struct dp_display_private, dp_display); dp->irq = irq_of_parse_and_map(dp->pdev->dev.of_node, 0); - if (dp->irq < 0) { - rc = dp->irq; - DRM_ERROR("failed to get irq: %d\n", rc); - return rc; + if (!dp->irq) { + DRM_ERROR("failed to get irq\n"); + return -EINVAL; } rc = devm_request_irq(&dp->pdev->dev, dp->irq, -- 2.25.1
WARNING: multiple messages have this Message-ID (diff)
From: cgel.zte@gmail.com To: dmitry.baryshkov@linaro.org Cc: airlied@linux.ie, bjorn.andersson@linaro.org, cgel.zte@gmail.com, dri-devel@lists.freedesktop.org, freedreno@lists.freedesktop.org, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, linux@roeck-us.net, lv.ruyi@zte.com.cn, quic_abhinavk@quicinc.com, quic_khsieh@quicinc.com, robdclark@gmail.com, sean@poorly.run, swboyd@chromium.org, Zeal Robot <zealci@zte.com.cn> Subject: [PATCH v2] drm/msm/dp: fix error check return value of irq_of_parse_and_map() Date: Sun, 24 Apr 2022 03:24:18 +0000 [thread overview] Message-ID: <20220424032418.3173632-1-lv.ruyi@zte.com.cn> (raw) In-Reply-To: <0e6028f6-3fc1-2a27-0a45-0e024c632248@linaro.org> From: Lv Ruyi <lv.ruyi@zte.com.cn> The irq_of_parse_and_map() function returns 0 on failure, and does not return an negative value. Fixes: 8ede2ecc3e5e ("drm/msm/dp: Add DP compliance tests on Snapdragon Chipsets") Reported-by: Zeal Robot <zealci@zte.com.cn> Signed-off-by: Lv Ruyi <lv.ruyi@zte.com.cn> --- v2: don't print rc, and return -EINVAL rather than 0 --- drivers/gpu/drm/msm/dp/dp_display.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/msm/dp/dp_display.c b/drivers/gpu/drm/msm/dp/dp_display.c index a42732b67349..c3566e6564b1 100644 --- a/drivers/gpu/drm/msm/dp/dp_display.c +++ b/drivers/gpu/drm/msm/dp/dp_display.c @@ -1239,10 +1239,9 @@ int dp_display_request_irq(struct msm_dp *dp_display) dp = container_of(dp_display, struct dp_display_private, dp_display); dp->irq = irq_of_parse_and_map(dp->pdev->dev.of_node, 0); - if (dp->irq < 0) { - rc = dp->irq; - DRM_ERROR("failed to get irq: %d\n", rc); - return rc; + if (!dp->irq) { + DRM_ERROR("failed to get irq\n"); + return -EINVAL; } rc = devm_request_irq(&dp->pdev->dev, dp->irq, -- 2.25.1
next prev parent reply other threads:[~2022-04-24 3:24 UTC|newest] Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top 2022-04-22 8:49 [PATCH] drm/msm/dp: fix error check return value of irq_of_parse_and_map() cgel.zte 2022-04-22 8:49 ` cgel.zte 2022-04-22 10:41 ` Dmitry Baryshkov 2022-04-22 10:41 ` Dmitry Baryshkov 2022-04-22 18:39 ` Stephen Boyd 2022-04-22 18:39 ` Stephen Boyd 2022-04-22 22:40 ` Dmitry Baryshkov 2022-04-22 22:40 ` Dmitry Baryshkov 2022-04-24 3:24 ` cgel.zte [this message] 2022-04-24 3:24 ` [PATCH v2] " cgel.zte 2022-04-25 22:25 ` Dmitry Baryshkov 2022-04-25 22:25 ` 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=20220424032418.3173632-1-lv.ruyi@zte.com.cn \ --to=cgel.zte@gmail.com \ --cc=airlied@linux.ie \ --cc=bjorn.andersson@linaro.org \ --cc=dmitry.baryshkov@linaro.org \ --cc=dri-devel@lists.freedesktop.org \ --cc=freedreno@lists.freedesktop.org \ --cc=linux-arm-msm@vger.kernel.org \ --cc=linux-kernel@vger.kernel.org \ --cc=linux@roeck-us.net \ --cc=lv.ruyi@zte.com.cn \ --cc=quic_abhinavk@quicinc.com \ --cc=quic_khsieh@quicinc.com \ --cc=sean@poorly.run \ --cc=swboyd@chromium.org \ --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.