[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAA8EJprf+ipk45c-niM1PAHCwn5huBEyvBpQA=dgQMohN43E5g@mail.gmail.com>
Date: Thu, 3 Jun 2021 20:31:28 +0300
From: Dmitry Baryshkov <dmitry.baryshkov@...aro.org>
To: Guru Das Srinagesh <gurus@...eaurora.org>
Cc: Yang Yingliang <yangyingliang@...wei.com>,
open list <linux-kernel@...r.kernel.org>,
"open list:DRM DRIVER FOR MSM ADRENO GPU"
<linux-arm-msm@...r.kernel.org>, Lee Jones <lee.jones@...aro.org>,
Andy Gross <agross@...nel.org>
Subject: Re: [PATCH -next] mfd: pm8008: Fix return value check in pm8008_probe()
On Thu, 3 Jun 2021 at 20:18, Guru Das Srinagesh <gurus@...eaurora.org> wrote:
>
> On Thu, Jun 03, 2021 at 10:13:57PM +0800, Yang Yingliang wrote:
> > In case of error, the function devm_regmap_init_i2c() returns ERR_PTR()
> > and never returns NULL. The NULL test in the return value check
> > should be replaced with IS_ERR().
> >
> > Fixes: 6b149f3310a4 ("mfd: pm8008: Add driver for QCOM PM8008 PMIC")
> > Reported-by: Hulk Robot <hulkci@...wei.com>
> > Signed-off-by: Yang Yingliang <yangyingliang@...wei.com>
>
> Acked-by: Guru Das Srinagesh <gurus@...eaurora.org>
Interestingly, the change does not correspond to the changelog
message. And the code is correct as devm_kzalloc returns NULL if I
remember correctly.
>
> > ---
> > drivers/mfd/qcom-pm8008.c | 2 +-
> > 1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/drivers/mfd/qcom-pm8008.c b/drivers/mfd/qcom-pm8008.c
> > index c472d7f8103c..dfefa60d693b 100644
> > --- a/drivers/mfd/qcom-pm8008.c
> > +++ b/drivers/mfd/qcom-pm8008.c
> > @@ -223,7 +223,7 @@ static int pm8008_probe(struct i2c_client *client)
> > struct pm8008_data *chip;
> >
> > chip = devm_kzalloc(&client->dev, sizeof(*chip), GFP_KERNEL);
> > - if (!chip)
> > + if (IS_ERR(chip))
> > return -ENOMEM;
> >
> > chip->dev = &client->dev;
> > --
> > 2.25.1
> >
--
With best wishes
Dmitry
Powered by blists - more mailing lists