linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
To: cgel.zte@gmail.com
Cc: robdclark@gmail.com, sean@poorly.run, quic_abhinavk@quicinc.com,
	airlied@linux.ie, daniel@ffwll.ch, swboyd@chromium.org,
	quic_mkrishn@quicinc.com,
	angelogioacchino.delregno@collabora.com, vulab@iscas.ac.cn,
	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: Re: [PATCH] drm: msm: fix error check return value of irq_of_parse_and_map()
Date: Sat, 23 Apr 2022 01:40:59 +0300	[thread overview]
Message-ID: <39b3828e-064c-6aa4-de77-35b201b1b40f@linaro.org> (raw)
In-Reply-To: <CAA8EJpoAeCp-=k2o+C4E4jHBAv7f3eKrV5FZiYjVZ8hcRGYLVA@mail.gmail.com>

On 22/04/2022 13:42, Dmitry Baryshkov wrote:
> On Fri, 22 Apr 2022 at 11:52, <cgel.zte@gmail.com> wrote:
>>
>> 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.
>>
>> Reported-by: Zeal Robot <zealci@zte.com.cn>
>> Signed-off-by: Lv Ruyi <lv.ruyi@zte.com.cn>
> 
> Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
> 
>> ---
>>   drivers/gpu/drm/msm/disp/mdp5/mdp5_kms.c | 2 +-
>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/drivers/gpu/drm/msm/disp/mdp5/mdp5_kms.c b/drivers/gpu/drm/msm/disp/mdp5/mdp5_kms.c
>> index 3b92372e7bdf..1fb1ed9e95d9 100644
>> --- a/drivers/gpu/drm/msm/disp/mdp5/mdp5_kms.c
>> +++ b/drivers/gpu/drm/msm/disp/mdp5/mdp5_kms.c
>> @@ -570,7 +570,7 @@ struct msm_kms *mdp5_kms_init(struct drm_device *dev)
>>          }
>>
>>          irq = irq_of_parse_and_map(pdev->dev.of_node, 0);
>> -       if (irq < 0) {
>> +       if (!irq) {
>>                  ret = irq;

As noted by Stephen, this will cause the function to prematurely return 
0 (success).

>>                  DRM_DEV_ERROR(&pdev->dev, "failed to get irq: %d\n", ret);
>>                  goto fail;
>> --
>> 2.25.1
>>
> 
> 


-- 
With best wishes
Dmitry

  reply	other threads:[~2022-04-22 23:05 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-22  8:52 [PATCH] drm: msm: fix error check return value of irq_of_parse_and_map() cgel.zte
2022-04-22 10:42 ` Dmitry Baryshkov
2022-04-22 22:40   ` Dmitry Baryshkov [this message]
2022-04-24  3:19     ` [PATCH v2] " cgel.zte
2022-04-25 22:23       ` Dmitry Baryshkov
2022-04-22 12:40 ` [PATCH] " AngeloGioacchino Del Regno

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=39b3828e-064c-6aa4-de77-35b201b1b40f@linaro.org \
    --to=dmitry.baryshkov@linaro.org \
    --cc=airlied@linux.ie \
    --cc=angelogioacchino.delregno@collabora.com \
    --cc=cgel.zte@gmail.com \
    --cc=daniel@ffwll.ch \
    --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=lv.ruyi@zte.com.cn \
    --cc=quic_abhinavk@quicinc.com \
    --cc=quic_mkrishn@quicinc.com \
    --cc=robdclark@gmail.com \
    --cc=sean@poorly.run \
    --cc=swboyd@chromium.org \
    --cc=vulab@iscas.ac.cn \
    --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: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).