mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
To: Robert Jarzmik <robert.jarzmik@free.fr>
Cc: barebox@lists.infradead.org
Subject: Re: [PATCH] usb/gadget: fix poller NPE in early polling
Date: Wed, 18 Jan 2012 23:56:38 +0100	[thread overview]
Message-ID: <20120118225638.GJ25622@game.jcrosoft.org> (raw)
In-Reply-To: <1326917859-25058-1-git-send-email-robert.jarzmik@free.fr>

On 21:17 Wed 18 Jan     , Robert Jarzmik wrote:
> The timings of the poller calling have changed, digging out
> a latent bug in pxa27x udc controller.
> The polling routine is called before the probe function is
> called, and the driver internal are not initialized at that
> time. This triggers a NULL pointer exception.
> 
> Fix it by adding an extra check.
> 
> Signed-off-by: Robert Jarzmik <robert.jarzmik@free.fr>
> ---
>  drivers/usb/gadget/pxa27x_udc.c |    5 ++++-
>  1 files changed, 4 insertions(+), 1 deletions(-)
> 
> diff --git a/drivers/usb/gadget/pxa27x_udc.c b/drivers/usb/gadget/pxa27x_udc.c
> index d0dbee9..bde9e74 100644
> --- a/drivers/usb/gadget/pxa27x_udc.c
> +++ b/drivers/usb/gadget/pxa27x_udc.c
> @@ -1508,7 +1508,10 @@ static struct driver_d udc_driver = {
>  
>  static int pxa27x_udc_poller(struct poller_struct *poller)
>  {
> -	return usb_gadget_poll();
> +	if (the_controller)
> +		return usb_gadget_poll();
> +	else
> +		return 0;
>  }
instead of this register thee poll at the probe

Best Regards,
J.

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

  reply	other threads:[~2012-01-18 22:57 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-01-18 20:17 Robert Jarzmik
2012-01-18 22:56 ` Jean-Christophe PLAGNIOL-VILLARD [this message]
2012-01-19 11:23   ` [PATCH V2] " Robert Jarzmik
2012-01-19 15:11     ` Marc Kleine-Budde
2012-01-20 20:17       ` [PATCH V3] " Robert Jarzmik
2012-01-23  8:48         ` Sascha Hauer
2012-01-23 16:25           ` Robert Jarzmik
2012-01-23 10:38         ` Jean-Christophe PLAGNIOL-VILLARD

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=20120118225638.GJ25622@game.jcrosoft.org \
    --to=plagnioj@jcrosoft.com \
    --cc=barebox@lists.infradead.org \
    --cc=robert.jarzmik@free.fr \
    /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