From: Mathias Nyman <mathias.nyman@linux.intel.com>
To: Klara Modin <klarasmodin@gmail.com>, gregkh@linuxfoundation.org
Cc: linux-usb@vger.kernel.org, stern@rowland.harvard.edu
Subject: Re: [PATCH v2] usb: usb-acpi: Set port connect type of not connectable ports correctly
Date: Fri, 8 Mar 2024 13:29:53 +0200 [thread overview]
Message-ID: <653d5a58-4a76-f93d-6b4b-36e5a44475a5@linux.intel.com> (raw)
In-Reply-To: <1cdfff7e-a63e-4618-b07e-e071187a3f14@gmail.com>
>> 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@gmail.com>
Thanks, I'll send a proper patch
-Mathias
prev parent reply other threads:[~2024-03-08 11:28 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-02-23 14:03 [PATCH v2] usb: usb-acpi: Set port connect type of not connectable ports correctly Mathias Nyman
2024-03-07 16:04 ` Klara Modin
2024-03-07 17:28 ` Klara Modin
2024-03-08 9:37 ` Mathias Nyman
2024-03-08 10:19 ` Klara Modin
2024-03-08 11:29 ` Mathias Nyman [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=653d5a58-4a76-f93d-6b4b-36e5a44475a5@linux.intel.com \
--to=mathias.nyman@linux.intel.com \
--cc=gregkh@linuxfoundation.org \
--cc=klarasmodin@gmail.com \
--cc=linux-usb@vger.kernel.org \
--cc=stern@rowland.harvard.edu \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox