]> git.baikalelectronics.ru Git - kernel.git/commit
PCI: hotplug: ACPI: Fix context refcounting in acpiphp_grab_context()
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>
Fri, 26 Jun 2020 17:42:34 +0000 (19:42 +0200)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Fri, 26 Jun 2020 17:42:34 +0000 (19:42 +0200)
commit83f2187b8cfb64a3a494dc08a199e82c6f4217a4
tree50beae1a66aef9c5a4d01b293d0d34bf8627271d
parent239bea99f45907d04135ef7b506467c1835f59f6
PCI: hotplug: ACPI: Fix context refcounting in acpiphp_grab_context()

If context is not NULL in acpiphp_grab_context(), but the
is_going_away flag is set for the device's parent, the reference
counter of the context needs to be decremented before returning
NULL or the context will never be freed, so make that happen.

Fixes: c97750f4d335 ("ACPI / dock: Use callback pointers from devices' ACPI hotplug contexts")
Reported-by: Vasily Averin <vvs@virtuozzo.com>
Cc: 3.15+ <stable@vger.kernel.org> # 3.15+
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
drivers/pci/hotplug/acpiphp_glue.c