Hi,

I can confirm that with the latest rc and the alterations you mentioned also 
solve the problem for me

I've found that the following change also works, if someone doesn't want to 
simply eliminate the check
diff --git a/drivers/usb/gadget/at91_udc.c b/drivers/usb/gadget/at91_udc.c
index 7687ccd..33a6999 100644
--- a/drivers/usb/gadget/at91_udc.c
+++ b/drivers/usb/gadget/at91_udc.c
@@ -475,7 +475,7 @@ static int at91_ep_enable(struct usb_ep *_ep,
        unsigned long   flags;

        if (!_ep || !ep
-                       || !desc || ep->ep.desc
+                       || !desc || !ep->ep.desc
                        || _ep->name == ep0name
                        || desc->bDescriptorType != USB_DT_ENDPOINT
                        || (maxpacket = usb_endpoint_maxp(desc)) == 0

Best regards,
Mário Isidoro

-----Original Message-----
From: Fabio Porcedda [mailto:fabio.porce...@gmail.com] 
Sent: terça-feira, 10 de Julho de 2012 10:04
To: Mario Jorge Isidoro; Sebastian Andrzej Siewior
Cc: ba...@ti.com; gre...@linuxfoundation.org; linux-usb@vger.kernel.org; 
Nicolas Ferre; Ido Shayevitz; Jean-Christophe PLAGNIOL-VILLARD
Subject: Re: NULL pointer dereference in at91_udc on start of connection

On Fri, Jul 6, 2012 at 8:06 PM, Mario Jorge Isidoro
<mario.isid...@tecmic.pt> wrote:
> Hi Fabio,
>
> I tried 3.4 and you were right, it still works fine.
>
> For the 'struct at91_ep' has no member named 'desc' error I tried commenting 
> the offending declaration (|| ep->desc)
> and it builds without any error. During the bisect run this happened several 
> times and I think, but am not sure, that some of
> this attempts worked fine without displaying the original error.

I'm happy to say that with the v3.5-rc6, after reverting the commit
f3d8bf34c2c925867322197096ed501ceab8085a and
removing the following line:

diff --git a/drivers/usb/gadget/at91_udc.c b/drivers/usb/gadget/at91_udc.c
index 7687ccd..98339a2 100644
--- a/drivers/usb/gadget/at91_udc.c
+++ b/drivers/usb/gadget/at91_udc.c
@@ -475,7 +475,6 @@ static int at91_ep_enable(struct usb_ep *_ep,
        unsigned long   flags;

        if (!_ep || !ep
-                       || !desc || ep->ep.desc
                        || _ep->name == ep0name
                        || desc->bDescriptorType != USB_DT_ENDPOINT
                        || (maxpacket = usb_endpoint_maxp(desc)) == 0

Now the at91_udc driver with g_ether it's working again.
I don't understand the reason, but now it seems to work fine.

If there isn't a better solution i propose to revert the commit
f3d8bf34c2c925867322197096ed501ceab8085a
and remove the line on the at91_udc driver.

Best regards
-- 
Fabio Porcedda
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to