All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] usb: usb-acpi: Fix oops due to freeing uninitialized pld pointer
@ 2024-03-08 11:34 Mathias Nyman
  2024-03-18 13:30 ` Aishwarya TCV
  0 siblings, 1 reply; 8+ messages in thread
From: Mathias Nyman @ 2024-03-08 11:34 UTC (permalink / raw)
  To: gregkh; +Cc: stern, linux-usb, Mathias Nyman, Klara Modin

If reading the ACPI _PLD port location object fails, or the port
doesn't have a _PLD ACPI object then the *pld pointer will remain
uninitialized and oops when freed.

The patch that caused this is currently in next, on its way to v6.9.
So no need to add this to stable or current 6.8 kernel.

Reported-by: Klara Modin <klarasmodin@gmail.com>
Closes: https://lore.kernel.org/linux-usb/7e92369a-3197-4883-9988-3c93452704f5@gmail.com/
Tested-by: Klara Modin <klarasmodin@gmail.com>
Fixes: f3ac348e6e04 ("usb: usb-acpi: Set port connect type of not connectable ports correctly")
Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com>
---
 drivers/usb/core/usb-acpi.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/usb/core/usb-acpi.c b/drivers/usb/core/usb-acpi.c
index f250dfc3b14d..7f8a912d4fe2 100644
--- a/drivers/usb/core/usb-acpi.c
+++ b/drivers/usb/core/usb-acpi.c
@@ -154,7 +154,7 @@ usb_acpi_get_connect_type(struct usb_port *port_dev, acpi_handle *handle)
 	enum usb_port_connect_type connect_type = USB_PORT_CONNECT_TYPE_UNKNOWN;
 	struct acpi_buffer buffer = { ACPI_ALLOCATE_BUFFER, NULL };
 	union acpi_object *upc = NULL;
-	struct acpi_pld_info *pld;
+	struct acpi_pld_info *pld = NULL;
 	acpi_status status;
 
 	/*
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2024-03-19 11:37 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-03-08 11:34 [PATCH] usb: usb-acpi: Fix oops due to freeing uninitialized pld pointer Mathias Nyman
2024-03-18 13:30 ` Aishwarya TCV
2024-03-18 14:36   ` Mathias Nyman
2024-03-18 14:40     ` Mark Brown
2024-03-18 14:55       ` Alan Stern
2024-03-18 15:10         ` Mark Brown
2024-03-19  7:29           ` Mathias Nyman
2024-03-19 11:37             ` Mark Brown

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.