aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorMathias Nyman <mathias.nyman@linux.intel.com>2024-03-08 13:34:25 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2024-03-19 13:07:35 +0100
commita788e53c05aee6e3d60792a59e10c0fac56b5086 (patch)
treec92c7ebca40232488963abf7e94cb9c14004714e
parentMerge tag 'usb-serial-6.9-rc1' of https://git.kernel.org/pub/scm/linux/kernel/git/johan/usb-serial into usb-next (diff)
downloadwireguard-linux-a788e53c05aee6e3d60792a59e10c0fac56b5086.tar.xz
wireguard-linux-a788e53c05aee6e3d60792a59e10c0fac56b5086.zip
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 <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> Link: https://lore.kernel.org/r/20240308113425.1144689-1-mathias.nyman@linux.intel.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--drivers/usb/core/usb-acpi.c2
1 files changed, 1 insertions, 1 deletions
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;
/*