[U-Boot] [PATCH] usb: gadget: composite: fix NULL pointer when a non standard request is received

Marek Vasut marex at denx.de
Thu Apr 26 13:15:12 UTC 2018


On 04/26/2018 03:13 PM, Patrice CHOTARD wrote:
> Hi
> 
> It's a gentle reminder as this patch is present on mailing list since 5 
> weeks without any feedback.

This should've been like a third non-gentle ping, seriously, two weeks
without feedback is already sucky. Time to buzz Lukasz, although he is
probably busy with personal stuff these days.

Applied

> Thanks
> 
> On 03/15/2018 09:34 AM, patrice.chotard at st.com wrote:
>> From: Christophe Kerello <christophe.kerello at st.com>
>>
>> In case usb configuration is unknown (cdev->config == NULL), non standard
>> request should not be processed.
>> Remove also the cdev->config check below which will never happen.
>>
>> This issue was seen using ums feature.
>>
>> Signed-off-by: Christophe Kerello <christophe.kerello at st.com>
>> Signed-off-by: Patrice Chotard <patrice.chotard at st.com>
>> ---
>>   drivers/usb/gadget/composite.c | 5 ++++-
>>   1 file changed, 4 insertions(+), 1 deletion(-)
>>
>> diff --git a/drivers/usb/gadget/composite.c b/drivers/usb/gadget/composite.c
>> index d0ee7847b98d..a87639def974 100644
>> --- a/drivers/usb/gadget/composite.c
>> +++ b/drivers/usb/gadget/composite.c
>> @@ -838,6 +838,9 @@ unknown:
>>   			ctrl->bRequestType, ctrl->bRequest,
>>   			w_value, w_index, w_length);
>>   
>> +		if (!cdev->config)
>> +			goto done;
>> +
>>   		/*
>>   		 * functions always handle their interfaces and endpoints...
>>   		 * punt other recipients (other, WUSB, ...) to the current
>> @@ -882,7 +885,7 @@ unknown:
>>   			value = f->setup(f, ctrl);
>>   		else {
>>   			c = cdev->config;
>> -			if (c && c->setup)
>> +			if (c->setup)
>>   				value = c->setup(c, ctrl);
>>   		}
>>   


-- 
Best regards,
Marek Vasut


More information about the U-Boot mailing list