RE: [kbuild] [usb:usb-next 32/38] drivers/usb/typec/hd3ss3220.c:182 hd3ss3220_probe() warn: passing zero to 'PTR_ERR'

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

 



Hi Dan Carpenter,

Thanks for the feedback.

> drivers/usb/typec/hd3ss3220.c:182 hd3ss3220_probe() warn: passing zero to
> 'PTR_ERR'
> 
> On Mon, Oct 07, 2019 at 02:19:05PM +0000, Biju Das wrote:
> > OK.  Are you ok with the below changes?
> >
> 
> It will generate a compile warning so no...  :P
> 
> > @@ -178,7 +178,7 @@ static int hd3ss3220_probe(struct i2c_client
> > *client,
> >
> >         hd3ss3220->role_sw = fwnode_usb_role_switch_get(connector);
> >         fwnode_handle_put(connector);
> > -       if (IS_ERR_OR_NULL(hd3ss3220->role_sw))
> > +       if (IS_ERR(hd3ss3220->role_sw))
> >                 return PTR_ERR(hd3ss3220->role_sw);
> >
> >         hd3ss3220->typec_cap.prefer_role = TYPEC_NO_PREFERRED_ROLE;
> @@
> > -188,20 +188,22 @@ static int hd3ss3220_probe(struct i2c_client
> > *client,
> >
> >         hd3ss3220->port = typec_register_port(&client->dev,
> >                                               &hd3ss3220->typec_cap);
> > -       if (IS_ERR(hd3ss3220->port))
> > +       if (IS_ERR(hd3ss3220->port)) {
> > +               usb_role_switch_put(hd3ss3220->role_sw);
> >                 return PTR_ERR(hd3ss3220->port);
> 
> 		ret = PTR_ERR(hd3ss3220->port);
> 		goto err_put_role

Got it. Will send a patch to  fix this.

Regards,
Biju

> > +       }
> 
> Otherwise I think it's the right thing.  Thanks!
> 
> regards,
> dan carpenter





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

  Powered by Linux