diff mbox series

ACPI / hotplug / PCI: lost acpiphp_put_context in acpiphp_grab_context()

Message ID 83d51ff2-a359-9a67-10d6-53c9c2287bf8@virtuozzo.com
State New
Headers show
Series ACPI / hotplug / PCI: lost acpiphp_put_context in acpiphp_grab_context() | expand

Commit Message

Vasily Averin June 13, 2020, 7:41 a.m. UTC
Fixes: edf5bf34d408 ("ACPI / dock: Use callback pointers from devices' ACPI hotplug contexts")
Signed-off-by: Vasily Averin <vvs@virtuozzo.com>
---
 drivers/pci/hotplug/acpiphp_glue.c | 2 ++
 1 file changed, 2 insertions(+)
diff mbox series

Patch

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);
 		acpi_unlock_hp_context();
 		return NULL;
 	}