Re: [PATCH v4 08/11] platform/x86: int3472: Add get_sensor_adev_and_name() helper

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

 



On Mon, Nov 1, 2021 at 12:44 PM Andy Shevchenko
<andy.shevchenko@xxxxxxxxx> wrote:
> On Mon, Nov 1, 2021 at 12:31 PM Hans de Goede <hdegoede@xxxxxxxxxx> wrote:
> > On 10/25/21 13:31, Andy Shevchenko wrote:
> > > On Mon, Oct 25, 2021 at 12:42 PM Hans de Goede <hdegoede@xxxxxxxxxx> wrote:

...

> > >> +       if (ret == 0 && sensor_adev_ret)
> > >> +               *sensor_adev_ret = sensor;
> > >> +       else
> > >> +               acpi_dev_put(sensor);
> > >> +
> > >> +       return ret;

...

> > >        if (sensor_adev_ret)
> > >                *sensor_adev_ret = sensor;
> > >
> > >        return 0;
> > >
> > > ?
> >
> > That misses an acpi_dev_put(sensor) when sensor_adev_ret == NULL.
>
> else
>   acpi_dev_put(...);
>
> ?

Hmm... But then in the original code and with this proposal the
acpi_dev_put() seems a bit strange to me.
If we are fine (no error code returned) why would the caller (note
_er_) go different paths?

-- 
With Best Regards,
Andy Shevchenko



[Index of Archives]     [Linux IBM ACPI]     [Linux Power Management]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]     [Linux Resources]

  Powered by Linux