From: Bjorn Andersson <bjorn.andersson@linaro.org>
To: cgel.zte@gmail.com
Cc: agross@kernel.org, srinivas.kandagatla@linaro.org,
gregkh@linuxfoundation.org, sdharia@codeaurora.org,
linux-arm-msm@vger.kernel.org, alsa-devel@alsa-project.org,
linux-kernel@vger.kernel.org, Lv Ruyi <lv.ruyi@zte.com.cn>,
Zeal Robot <zealci@zte.com.cn>
Subject: Re: [PATCH] slimbus: qcom: fix error check return value of platform_get_irq()
Date: Tue, 12 Apr 2022 09:29:15 -0500 [thread overview]
Message-ID: <YlWMu9D/6nVl5tqV@builder.lan> (raw)
In-Reply-To: <20220412090259.2533316-1-lv.ruyi@zte.com.cn>
On Tue 12 Apr 04:02 CDT 2022, cgel.zte@gmail.com wrote:
> From: Lv Ruyi <lv.ruyi@zte.com.cn>
>
> platform_get_irq() return negative value on failure, so null check of
> ctrl->irq is incorrect. Fix it by comparing whether it is less than zero.
>
> Fixes: ad7fcbc308b0 ("slimbus: qcom: Add Qualcomm Slimbus controller driver")
> Reported-by: Zeal Robot <zealci@zte.com.cn>
> Signed-off-by: Lv Ruyi <lv.ruyi@zte.com.cn>
Reviewed-by: Bjorn Andersson <bjorn.andersson@linaro.org>
> ---
> drivers/slimbus/qcom-ctrl.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/slimbus/qcom-ctrl.c b/drivers/slimbus/qcom-ctrl.c
> index f04b961b96cd..b2f01e155d77 100644
> --- a/drivers/slimbus/qcom-ctrl.c
> +++ b/drivers/slimbus/qcom-ctrl.c
> @@ -510,7 +510,7 @@ static int qcom_slim_probe(struct platform_device *pdev)
> }
>
> ctrl->irq = platform_get_irq(pdev, 0);
> - if (!ctrl->irq) {
> + if (ctrl->irq < 0) {
> dev_err(&pdev->dev, "no slimbus IRQ\n");
> return -ENODEV;
> }
> --
> 2.25.1
>
next prev parent reply other threads:[~2022-04-12 14:29 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-04-12 9:02 [PATCH] slimbus: qcom: fix error check return value of platform_get_irq() cgel.zte
2022-04-12 14:29 ` Bjorn Andersson [this message]
2022-04-12 15:01 ` Srinivas Kandagatla
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=YlWMu9D/6nVl5tqV@builder.lan \
--to=bjorn.andersson@linaro.org \
--cc=agross@kernel.org \
--cc=alsa-devel@alsa-project.org \
--cc=cgel.zte@gmail.com \
--cc=gregkh@linuxfoundation.org \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=lv.ruyi@zte.com.cn \
--cc=sdharia@codeaurora.org \
--cc=srinivas.kandagatla@linaro.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: 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