public inbox for kernel-janitors@vger.kernel.org
 help / color / mirror / Atom feed
From: Peter Chen <peter.chen@freescale.com>
To: kernel-janitors@vger.kernel.org
Subject: Re: [patch] usb: chipidea: fix a NULL dereference on error
Date: Fri, 16 Aug 2013 09:32:14 +0000	[thread overview]
Message-ID: <20130816093212.GA4390@shlinux1.ap.freescale.net> (raw)
In-Reply-To: <20130816073410.GB9881@elgon.mountain>

On Fri, Aug 16, 2013 at 10:34:10AM +0300, Dan Carpenter wrote:
> The regulator_disable() function can't accept NULL pointers so we need
> to add a check.
> 
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
> 
> diff --git a/drivers/usb/chipidea/host.c b/drivers/usb/chipidea/host.c
> index 6f96795..abfb1cc 100644
> --- a/drivers/usb/chipidea/host.c
> +++ b/drivers/usb/chipidea/host.c
> @@ -88,7 +88,8 @@ static int host_start(struct ci_hdrc *ci)
>  	return ret;
>  
>  disable_reg:
> -	regulator_disable(ci->platdata->reg_vbus);
> +	if (ci->platdata->reg_vbus)
> +		regulator_disable(ci->platdata->reg_vbus);
>  
>  put_hcd:
>  	usb_put_hcd(hcd);
> --
> To unsubscribe from this list: send the line "unsubscribe linux-usb" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 

Acked-by: Peter Chen <peter.chen@freescale.com>

-- 

Best Regards,
Peter Chen


      reply	other threads:[~2013-08-16  9:32 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-08-16  7:34 [patch] usb: chipidea: fix a NULL dereference on error Dan Carpenter
2013-08-16  9:32 ` Peter Chen [this message]

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=20130816093212.GA4390@shlinux1.ap.freescale.net \
    --to=peter.chen@freescale.com \
    --cc=kernel-janitors@vger.kernel.org \
    /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