Re: [PATCH] ACPI / hotplug / PCI: lost acpiphp_put_context in acpiphp_grab_context()

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

 



On Sat, Jun 13, 2020 at 9:41 AM Vasily Averin <vvs@xxxxxxxxxxxxx> wrote:
>
> Fixes: edf5bf34d408 ("ACPI / dock: Use callback pointers from devices' ACPI hotplug contexts")

Thanks for the fix ->

> Signed-off-by: Vasily Averin <vvs@xxxxxxxxxxxxx>
> ---
>  drivers/pci/hotplug/acpiphp_glue.c | 2 ++
>  1 file changed, 2 insertions(+)
>
> diff --git a/drivers/pci/hotplug/acpiphp_glue.c b/drivers/pci/hotplug/acpiphp_glue.c
> index b386995..e49ec95 100644
> --- a/drivers/pci/hotplug/acpiphp_glue.c
> +++ b/drivers/pci/hotplug/acpiphp_glue.c
> @@ -124,6 +124,8 @@ static struct acpiphp_context *acpiphp_grab_context(struct acpi_device *adev)
>         acpi_lock_hp_context();
>         context = acpiphp_get_context(adev);
>         if (!context || context->func.parent->is_going_away) {
> +               if (context)
> +                       acpiphp_put_context(context);

-> but I'd prefer:

        if (context && context->func.parent->is_going_away) {
                      acpiphp_put_context(context);
                      context = NULL;
       }
       if (!context) {

>                 acpi_unlock_hp_context();
>                 return NULL;
>         }
> --

Thanks!



[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