Re: [PATCH] powercap: intel_rapl: Fix a NULL vs IS_ERR() bug

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Jun 6, 2023 at 10:56 AM Zhang, Rui <rui.zhang@xxxxxxxxx> wrote:
>
> On Tue, 2023-06-06 at 11:22 +0300, Dan Carpenter wrote:
> > The devm_ioremap_resource() function returns error pointers on error,
> > it never returns NULL.  Update the check accordingly.
> >
> > Fixes: 9eef7f9da928 ("powercap: intel_rapl: Introduce RAPL TPMI
> > interface driver")
> > Signed-off-by: Dan Carpenter <dan.carpenter@xxxxxxxxxx>
>
> Acked-by: Zhang Rui <rui.zhang@xxxxxxxxx>

Applied as 6.5 material, thanks!

> > ---
> >  drivers/powercap/intel_rapl_tpmi.c | 4 ++--
> >  1 file changed, 2 insertions(+), 2 deletions(-)
> >
> > diff --git a/drivers/powercap/intel_rapl_tpmi.c
> > b/drivers/powercap/intel_rapl_tpmi.c
> > index c016127b3497..4f4f13ded225 100644
> > --- a/drivers/powercap/intel_rapl_tpmi.c
> > +++ b/drivers/powercap/intel_rapl_tpmi.c
> > @@ -255,8 +255,8 @@ static int intel_rapl_tpmi_probe(struct
> > auxiliary_device *auxdev,
> >         }
> >
> >         trp->base = devm_ioremap_resource(&auxdev->dev, res);
> > -       if (!trp->base) {
> > -               ret = -ENOMEM;
> > +       if (IS_ERR(trp->base)) {
> > +               ret = PTR_ERR(trp->base);
> >                 goto err;
> >         }
> >
>



[Index of Archives]     [Kernel Development]     [Kernel Announce]     [Kernel Newbies]     [Linux Networking Development]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Device Mapper]

  Powered by Linux