From: Sebastian Reichel <sre@kernel.org> To: Wei Yongjun <weiyongjun1@huawei.com> Cc: Linus Walleij <linus.walleij@linaro.org>, linux-pm@vger.kernel.org, kernel-janitors@vger.kernel.org Subject: Re: [PATCH -next] power: supply: ab8500_charger: Fix wrong pointer passed to PTR_ERR() Date: Sun, 27 Oct 2019 21:34:56 +0000 [thread overview] Message-ID: <20191027213456.yexbg6kzgt7vl5fm@earth.universe> (raw) In-Reply-To: <20191022111856.44118-1-weiyongjun1@huawei.com> [-- Attachment #1: Type: text/plain, Size: 1273 bytes --] Hi, On Tue, Oct 22, 2019 at 11:18:56AM +0000, Wei Yongjun wrote: > PTR_ERR should access the value just tested by IS_ERR, otherwise > the wrong error code will be returned. > > Fixes: 97ab78bac5d0 ("power: supply: ab8500_charger: Convert to IIO ADC") > Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com> > --- Thanks for the patch. Gustavo A. R. Silva send an identical patch one day earlier, so I applied his patch and added an Reviewed-by from you. -- Sebastian > drivers/power/supply/ab8500_charger.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/power/supply/ab8500_charger.c b/drivers/power/supply/ab8500_charger.c > index ff2bb4411a22..8a0f9d769690 100644 > --- a/drivers/power/supply/ab8500_charger.c > +++ b/drivers/power/supply/ab8500_charger.c > @@ -3393,7 +3393,7 @@ static int ab8500_charger_probe(struct platform_device *pdev) > if (PTR_ERR(di->adc_main_charger_c) == -ENODEV) > return -EPROBE_DEFER; > dev_err(&pdev->dev, "failed to get ADC main charger current\n"); > - return PTR_ERR(di->adc_main_charger_v); > + return PTR_ERR(di->adc_main_charger_c); > } > di->adc_vbus_v = devm_iio_channel_get(&pdev->dev, "vbus_v"); > if (IS_ERR(di->adc_vbus_v)) { > > > [-- Attachment #2: signature.asc --] [-- Type: application/pgp-signature, Size: 833 bytes --]
WARNING: multiple messages have this Message-ID (diff)
From: Sebastian Reichel <sre@kernel.org> To: Wei Yongjun <weiyongjun1@huawei.com> Cc: Linus Walleij <linus.walleij@linaro.org>, linux-pm@vger.kernel.org, kernel-janitors@vger.kernel.org Subject: Re: [PATCH -next] power: supply: ab8500_charger: Fix wrong pointer passed to PTR_ERR() Date: Sun, 27 Oct 2019 22:34:56 +0100 [thread overview] Message-ID: <20191027213456.yexbg6kzgt7vl5fm@earth.universe> (raw) In-Reply-To: <20191022111856.44118-1-weiyongjun1@huawei.com> [-- Attachment #1: Type: text/plain, Size: 1273 bytes --] Hi, On Tue, Oct 22, 2019 at 11:18:56AM +0000, Wei Yongjun wrote: > PTR_ERR should access the value just tested by IS_ERR, otherwise > the wrong error code will be returned. > > Fixes: 97ab78bac5d0 ("power: supply: ab8500_charger: Convert to IIO ADC") > Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com> > --- Thanks for the patch. Gustavo A. R. Silva send an identical patch one day earlier, so I applied his patch and added an Reviewed-by from you. -- Sebastian > drivers/power/supply/ab8500_charger.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/power/supply/ab8500_charger.c b/drivers/power/supply/ab8500_charger.c > index ff2bb4411a22..8a0f9d769690 100644 > --- a/drivers/power/supply/ab8500_charger.c > +++ b/drivers/power/supply/ab8500_charger.c > @@ -3393,7 +3393,7 @@ static int ab8500_charger_probe(struct platform_device *pdev) > if (PTR_ERR(di->adc_main_charger_c) == -ENODEV) > return -EPROBE_DEFER; > dev_err(&pdev->dev, "failed to get ADC main charger current\n"); > - return PTR_ERR(di->adc_main_charger_v); > + return PTR_ERR(di->adc_main_charger_c); > } > di->adc_vbus_v = devm_iio_channel_get(&pdev->dev, "vbus_v"); > if (IS_ERR(di->adc_vbus_v)) { > > > [-- Attachment #2: signature.asc --] [-- Type: application/pgp-signature, Size: 833 bytes --]
next prev parent reply other threads:[~2019-10-27 21:34 UTC|newest] Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top 2019-10-22 11:18 [PATCH -next] power: supply: ab8500_charger: Fix wrong pointer passed to PTR_ERR() Wei Yongjun 2019-10-22 11:18 ` Wei Yongjun 2019-10-22 11:36 ` Linus Walleij 2019-10-22 11:36 ` Linus Walleij 2019-10-27 21:34 ` Sebastian Reichel [this message] 2019-10-27 21:34 ` 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=20191027213456.yexbg6kzgt7vl5fm@earth.universe \ --to=sre@kernel.org \ --cc=kernel-janitors@vger.kernel.org \ --cc=linus.walleij@linaro.org \ --cc=linux-pm@vger.kernel.org \ --cc=weiyongjun1@huawei.com \ /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.