Re: [PATCH] usb: musb: jz4740: fix error check of usb_get_phy()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Mar 09, 2016 at 03:17:21AM +0200, Vladimir Zapolskiy wrote:
> Hi Felipe,
> 
> On 09.03.2016 02:57, Vladimir Zapolskiy wrote:
> > The usb_get_phy() function returns either a valid pointer to phy or
> > ERR_PTR() error, check for NULL always fails and may lead to oops on
> > error path, fix this issue.
> > 
> > Signed-off-by: Vladimir Zapolskiy <vz@xxxxxxxxx>
> > ---
> >  drivers/usb/musb/jz4740.c | 4 ++--
> >  1 file changed, 2 insertions(+), 2 deletions(-)
> > 
> > diff --git a/drivers/usb/musb/jz4740.c b/drivers/usb/musb/jz4740.c
> > index 5e5a8fa..bc88899 100644
> > --- a/drivers/usb/musb/jz4740.c
> > +++ b/drivers/usb/musb/jz4740.c
> > @@ -83,9 +83,9 @@ static int jz4740_musb_init(struct musb *musb)
> >  {
> >  	usb_phy_generic_register();
> >  	musb->xceiv = usb_get_phy(USB_PHY_TYPE_USB2);
> > -	if (!musb->xceiv) {
> > +	if (IS_ERR(musb->xceiv)) {
> >  		pr_err("HS UDC: no transceiver configured\n");
> > -		return -ENODEV;
> > +		return PTR_ERR(musb->xceiv);
> >  	}
> >  
> >  	/* Silicon does not implement ConfigData register.
> > 
> 
> FYI I got this message :
> 
> <balbi@xxxxxx>: host cluster5.us.messagelabs.com[216.82.242.147] said: 550
>     Invalid recipient <balbi@xxxxxx> (#5.1.1) (in reply to RCPT TO command)
> 
> You may consider to update your email address in MAINTAINERS.

He did, you might consider updating your kernel tree :)

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



[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux