[PATCH 3/6] usb: xhci: Abort transfers with unallocated rings

Janne Grunau j at jannau.net
Sun Feb 25 16:30:35 CET 2024


Hej,

On Wed, Feb 21, 2024, at 13:40, Marek Vasut wrote:
> On 2/21/24 08:25, Janne Grunau via B4 Relay wrote:
>> From: Janne Grunau <j at jannau.net>
>> 
>> Discovered while trying to use the second interface in the USB keyboard
>> driver necessary on Apple USB keyboards.
>> 
>> Signed-off-by: Janne Grunau <j at jannau.net>
>> ---
>>   drivers/usb/host/xhci-ring.c | 5 +++++
>>   1 file changed, 5 insertions(+)
>> 
>> diff --git a/drivers/usb/host/xhci-ring.c b/drivers/usb/host/xhci-ring.c
>> index b60661fe05..4446f5f098 100644
>> --- a/drivers/usb/host/xhci-ring.c
>> +++ b/drivers/usb/host/xhci-ring.c
>> @@ -685,6 +685,9 @@ int xhci_bulk_tx(struct usb_device *udev, unsigned long pipe,
>>   		reset_ep(udev, ep_index);
>>   
>>   	ring = virt_dev->eps[ep_index].ring;
>> +	if (!ring)
>> +		return -1;
>
> Would it make sense to return e.g. -EINVAL or some other errno ?

Agreed, -EINVAL is good match as ep_index is directly derived from pipe argument.

Janne


More information about the U-Boot mailing list