[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <fdd4f94d-fb8c-44a0-9472-3485a567caca@moroto.mountain>
Date: Fri, 15 Mar 2024 18:21:00 +0300
From: Dan Carpenter <dan.carpenter@...aro.org>
To: Mathias Nyman <mathias.nyman@...ux.intel.com>
Cc: Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Andy Shevchenko <andriy.shevchenko@...ux.intel.com>,
linux-usb@...r.kernel.org, linux-kernel@...r.kernel.org,
kernel-janitors@...r.kernel.org
Subject: [PATCH] usb: usb-acpi: fix uninitialized variable in
usb_acpi_get_connect_type()
The "pld" pointer is uninitialized if acpi_get_physical_device_location()
fails. Initialize it to NULL.
Fixes: f3ac348e6e04 ("usb: usb-acpi: Set port connect type of not connectable ports correctly")
Signed-off-by: Dan Carpenter <dan.carpenter@...aro.org>
---
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..2aeeaa389380 100644
--- a/drivers/usb/core/usb-acpi.c
+++ b/drivers/usb/core/usb-acpi.c
@@ -153,8 +153,8 @@ 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 };
+ struct acpi_pld_info *pld = NULL;
union acpi_object *upc = NULL;
- struct acpi_pld_info *pld;
acpi_status status;
/*
--
2.43.0
Powered by blists - more mailing lists