Re: [PATCH v2] usb: usb-acpi: Set port connect type of not connectable ports correctly

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

 




Looks like *pld might never get set in some error cases, and we end up
freeing some random pointer.
i.e if status = acpi_get_physical_device_location(handle, &pld) fails

Could you try if this helps:

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;

         /*

Thanks
Mathias

That indeed looks to be the case, this fixes the issue for me.

Thanks,
Tested-by: Klara Modin <klarasmodin@xxxxxxxxx>

Thanks, I'll send a proper patch

-Mathias




[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux