Skip to content

Commit a788e53

Browse files
matnymangregkh
authored andcommitted
usb: usb-acpi: Fix oops due to freeing uninitialized pld pointer
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 <[email protected]> Closes: https://lore.kernel.org/linux-usb/[email protected]/ Tested-by: Klara Modin <[email protected]> Fixes: f3ac348 ("usb: usb-acpi: Set port connect type of not connectable ports correctly") Signed-off-by: Mathias Nyman <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent d99e42c commit a788e53

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/usb/core/usb-acpi.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ usb_acpi_get_connect_type(struct usb_port *port_dev, acpi_handle *handle)
154154
enum usb_port_connect_type connect_type = USB_PORT_CONNECT_TYPE_UNKNOWN;
155155
struct acpi_buffer buffer = { ACPI_ALLOCATE_BUFFER, NULL };
156156
union acpi_object *upc = NULL;
157-
struct acpi_pld_info *pld;
157+
struct acpi_pld_info *pld = NULL;
158158
acpi_status status;
159159

160160
/*

0 commit comments

Comments
 (0)