From: Hans de Goede <hdegoede@redhat.com>
To: Denis Arefev <arefev@swemel.ru>, Sebastian Reichel <sre@kernel.org>
Cc: Chen-Yu Tsai <wens@csie.org>,
linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org,
lvc-project@linuxtesting.org, trufanov@swemel.ru, vfh@swemel.ru
Subject: Re: [PATCH] power: supply: Added check for negative values
Date: Tue, 6 Dec 2022 18:11:23 +0100 [thread overview]
Message-ID: <1184e45f-d88c-b8b1-952d-7d6bd1ae2129@redhat.com> (raw)
In-Reply-To: <20221206091723.28656-1-arefev@swemel.ru>
Hi,
On 12/6/22 10:17, Denis Arefev wrote:
> Variable 'pirq', which may receive negative value
> in platform_get_irq().
> Used as an index in a function regmap_irq_get_virq().
>
> Found by Linux Verification Center (linuxtesting.org) with SVACE.
>
> Signed-off-by: Denis Arefev <arefev@swemel.ru>
Thanks, patch looks good to me:
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Regards,
Hans
> ---
> drivers/power/supply/axp288_fuel_gauge.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/drivers/power/supply/axp288_fuel_gauge.c b/drivers/power/supply/axp288_fuel_gauge.c
> index 148eb8105803..36c7039c99c2 100644
> --- a/drivers/power/supply/axp288_fuel_gauge.c
> +++ b/drivers/power/supply/axp288_fuel_gauge.c
> @@ -640,6 +640,8 @@ static void fuel_gauge_init_irq(struct axp288_fg_info *info)
>
> for (i = 0; i < AXP288_FG_INTR_NUM; i++) {
> pirq = platform_get_irq(info->pdev, i);
> + if (pirq < 0)
> + continue;
> info->irq[i] = regmap_irq_get_virq(info->regmap_irqc, pirq);
> if (info->irq[i] < 0) {
> dev_warn(&info->pdev->dev,
next prev parent reply other threads:[~2022-12-06 17:12 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-12-06 9:17 Denis Arefev
2022-12-06 17:11 ` Hans de Goede [this message]
2023-01-02 22:19 ` Sebastian Reichel
-- strict thread matches above, loose matches on Subject: below --
2022-11-17 12:01 Denis Arefev
2022-11-17 22:45 ` Sebastian Reichel
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=1184e45f-d88c-b8b1-952d-7d6bd1ae2129@redhat.com \
--to=hdegoede@redhat.com \
--cc=arefev@swemel.ru \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=lvc-project@linuxtesting.org \
--cc=sre@kernel.org \
--cc=trufanov@swemel.ru \
--cc=vfh@swemel.ru \
--cc=wens@csie.org \
/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
all inboxes | Powered by JetHome®