All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] [PATCH] USB-CDC: wrong ep status used
@ 2010-08-11 21:41 Stefano Babic
  2010-08-12 10:13 ` Vitaly Kuzmichev
  0 siblings, 1 reply; 6+ messages in thread
From: Stefano Babic @ 2010-08-11 21:41 UTC (permalink / raw)
  To: u-boot

In case a status ep is requested, it is always allocated
a request for the ep0, instead of the correct one saved
in the dev structure.

Signed-off-by: Stefano Babic <sbabic@denx.de>
---
 drivers/usb/gadget/ether.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/usb/gadget/ether.c b/drivers/usb/gadget/ether.c
index 9f9b093..1481d76 100644
--- a/drivers/usb/gadget/ether.c
+++ b/drivers/usb/gadget/ether.c
@@ -1731,14 +1731,14 @@ autoconf_fail:
 	/* ... and maybe likewise for status transfer */
 #if defined(DEV_CONFIG_CDC)
 	if (dev->status_ep) {
-		dev->stat_req = usb_ep_alloc_request(gadget->ep0, GFP_KERNEL);
-		dev->stat_req->buf = status_req;
+		dev->stat_req = usb_ep_alloc_request(dev->status_ep, GFP_KERNEL);
 		if (!dev->stat_req) {
 			dev->stat_req->buf=NULL;
-			usb_ep_free_request (gadget->ep0, dev->req);
+			usb_ep_free_request (dev->status_ep, dev->req);
 
 			goto fail;
 		}
+		dev->stat_req->buf = status_req;
 		dev->stat_req->context = NULL;
 	}
 #endif
-- 
1.6.3.3

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [U-Boot] [PATCH] USB-CDC: wrong ep status used
  2010-08-11 21:41 [U-Boot] [PATCH] USB-CDC: wrong ep status used Stefano Babic
@ 2010-08-12 10:13 ` Vitaly Kuzmichev
  2010-08-12 12:28   ` Stefano Babic
  0 siblings, 1 reply; 6+ messages in thread
From: Vitaly Kuzmichev @ 2010-08-12 10:13 UTC (permalink / raw)
  To: u-boot

Hi Stefano,

On 08/12/2010 01:41 AM, Stefano Babic wrote:
>  #if defined(DEV_CONFIG_CDC)
>  	if (dev->status_ep) {
> -		dev->stat_req = usb_ep_alloc_request(gadget->ep0, GFP_KERNEL);
> -		dev->stat_req->buf = status_req;
> +		dev->stat_req = usb_ep_alloc_request(dev->status_ep, GFP_KERNEL);
>  		if (!dev->stat_req) {
>  			dev->stat_req->buf=NULL;
We get oops here!

> -			usb_ep_free_request (gadget->ep0, dev->req);
> +			usb_ep_free_request (dev->status_ep, dev->req);
>  
>  			goto fail;
>  		}
> +		dev->stat_req->buf = status_req;
>  		dev->stat_req->context = NULL;
>  	}
>  #endif

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [U-Boot] [PATCH] USB-CDC: wrong ep status used
  2010-08-12 10:13 ` Vitaly Kuzmichev
@ 2010-08-12 12:28   ` Stefano Babic
  2010-08-12 17:05     ` Sergei Shtylyov
  0 siblings, 1 reply; 6+ messages in thread
From: Stefano Babic @ 2010-08-12 12:28 UTC (permalink / raw)
  To: u-boot

Vitaly Kuzmichev wrote:
> Hi Stefano,
> 
> On 08/12/2010 01:41 AM, Stefano Babic wrote:
>>  #if defined(DEV_CONFIG_CDC)
>>  	if (dev->status_ep) {
>> -		dev->stat_req = usb_ep_alloc_request(gadget->ep0, GFP_KERNEL);
>> -		dev->stat_req->buf = status_req;
>> +		dev->stat_req = usb_ep_alloc_request(dev->status_ep, GFP_KERNEL);
>>  		if (!dev->stat_req) {
>>  			dev->stat_req->buf=NULL;
> We get oops here!

Agree, and the issue is not related to this patch, I missed to correct
it, thanks. If no one complains, I will send a single patch to fix both
problems (wrong ep status + null pointer access).

Best regards,
Stefano

-- 
=====================================================================
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-0 Fax: +49-8142-66989-80  Email: office at denx.de
=====================================================================

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [U-Boot] [PATCH] USB-CDC: wrong ep status used
  2010-08-12 12:28   ` Stefano Babic
@ 2010-08-12 17:05     ` Sergei Shtylyov
  2010-08-13  9:16       ` Vitaly Kuzmichev
  0 siblings, 1 reply; 6+ messages in thread
From: Sergei Shtylyov @ 2010-08-12 17:05 UTC (permalink / raw)
  To: u-boot

Hello.

Stefano Babic wrote:

>> On 08/12/2010 01:41 AM, Stefano Babic wrote:
>>>  #if defined(DEV_CONFIG_CDC)
>>>  	if (dev->status_ep) {
>>> -		dev->stat_req = usb_ep_alloc_request(gadget->ep0, GFP_KERNEL);
>>> -		dev->stat_req->buf = status_req;
>>> +		dev->stat_req = usb_ep_alloc_request(dev->status_ep, GFP_KERNEL);
>>>  		if (!dev->stat_req) {
>>>  			dev->stat_req->buf=NULL;
>> We get oops here!

> Agree, and the issue is not related to this patch, I missed to correct
> it, thanks. If no one complains, I will send a single patch to fix both
> problems (wrong ep status + null pointer access).

    Looks like Vitaly has done the same already:

http://lists.denx.de/pipermail/u-boot/2010-August/075419.html

> Best regards,
> Stefano

WBR, Sergei

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [U-Boot] [PATCH] USB-CDC: wrong ep status used
  2010-08-12 17:05     ` Sergei Shtylyov
@ 2010-08-13  9:16       ` Vitaly Kuzmichev
  2010-08-13  9:19         ` Stefano Babic
  0 siblings, 1 reply; 6+ messages in thread
From: Vitaly Kuzmichev @ 2010-08-13  9:16 UTC (permalink / raw)
  To: u-boot

Hi Sergei,

On 08/12/2010 09:05 PM, Sergei Shtylyov wrote:
> Hello.
> 
> Stefano Babic wrote:
> 
>>> We get oops here!
> 
>> Agree, and the issue is not related to this patch, I missed to correct
>> it, thanks. If no one complains, I will send a single patch to fix both
>> problems (wrong ep status + null pointer access).
> 
>    Looks like Vitaly has done the same already:
> 
Yes, but I have not seen Stefano's comment when sent.

Stefano,
I would like to add you 'signed-off' in this patch because I took this
part from your patch:
-			usb_ep_free_request (gadget->ep0, dev->req);
+			usb_ep_free_request (dev->status_ep, dev->req);

Do you allow me to add your signature?

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [U-Boot] [PATCH] USB-CDC: wrong ep status used
  2010-08-13  9:16       ` Vitaly Kuzmichev
@ 2010-08-13  9:19         ` Stefano Babic
  0 siblings, 0 replies; 6+ messages in thread
From: Stefano Babic @ 2010-08-13  9:19 UTC (permalink / raw)
  To: u-boot

Vitaly Kuzmichev wrote:
> Hi Sergei,
> 
> On 08/12/2010 09:05 PM, Sergei Shtylyov wrote:
>> Hello.
>>
>> Stefano Babic wrote:
>>
>>>> We get oops here!
>>> Agree, and the issue is not related to this patch, I missed to correct
>>> it, thanks. If no one complains, I will send a single patch to fix both
>>> problems (wrong ep status + null pointer access).
>>    Looks like Vitaly has done the same already:
>>
> Yes, but I have not seen Stefano's comment when sent.
> 
> Stefano,
> I would like to add you 'signed-off' in this patch because I took this
> part from your patch:
> -			usb_ep_free_request (gadget->ep0, dev->req);
> +			usb_ep_free_request (dev->status_ep, dev->req);
> 
> Do you allow me to add your signature?
> 

Yes, of course !

Stefano

-- 
=====================================================================
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-0 Fax: +49-8142-66989-80  Email: office at denx.de
=====================================================================

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2010-08-13  9:19 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-08-11 21:41 [U-Boot] [PATCH] USB-CDC: wrong ep status used Stefano Babic
2010-08-12 10:13 ` Vitaly Kuzmichev
2010-08-12 12:28   ` Stefano Babic
2010-08-12 17:05     ` Sergei Shtylyov
2010-08-13  9:16       ` Vitaly Kuzmichev
2010-08-13  9:19         ` Stefano Babic

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.