RE: [PATCH v3 1/4] usb: typec: ucsi: set con->port to NULL when register port fail

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

 



> From: Heikki Krogerus <heikki.krogerus@xxxxxxxxxxxxxxx>
> Sent: Wednesday, April 13, 2022 7:32 PM
> To: Linyu Yuan (QUIC) <quic_linyyuan@xxxxxxxxxxx>
> Cc: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>; linux-
> usb@xxxxxxxxxxxxxxx; Jack Pham (QUIC) <quic_jackp@xxxxxxxxxxx>
> Subject: Re: [PATCH v3 1/4] usb: typec: ucsi: set con->port to NULL when
> register port fail
> 
> On Wed, Apr 13, 2022 at 05:58:08PM +0800, Linyu Yuan wrote:
> > As con->port will be used in error path of ucsi_init(),
> > it should be NULL or valid.
> >
> > Signed-off-by: Linyu Yuan <quic_linyyuan@xxxxxxxxxxx>
> > ---
> > v2: no change
> > v3: no change
> >
> >  drivers/usb/typec/ucsi/ucsi.c | 1 +
> >  1 file changed, 1 insertion(+)
> >
> > diff --git a/drivers/usb/typec/ucsi/ucsi.c b/drivers/usb/typec/ucsi/ucsi.c
> > index f0c2fa1..77ac0b7 100644
> > --- a/drivers/usb/typec/ucsi/ucsi.c
> > +++ b/drivers/usb/typec/ucsi/ucsi.c
> > @@ -1100,6 +1100,7 @@ static int ucsi_register_port(struct ucsi *ucsi, int
> index)
> >  	con->port = typec_register_port(ucsi->dev, cap);
> >  	if (IS_ERR(con->port)) {
> >  		ret = PTR_ERR(con->port);
> > +		con->port = NULL;
> >  		goto out;
> >  	}
> 
> Please merge this into the next patch.
Sure, will do after all discussion are done.
> 
> thanks,
> 
> --
> heikki




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

  Powered by Linux