lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Yx8/dtzrkRE4iFea@hovoldconsulting.com>
Date:   Mon, 12 Sep 2022 16:17:26 +0200
From:   Johan Hovold <johan@...nel.org>
To:     Greg KH <gregkh@...uxfoundation.org>
Cc:     cgel.zte@...il.com, linux-usb@...r.kernel.org,
        linux-kernel@...r.kernel.org, Xu Panda <xu.panda@....com.cn>,
        Zeal Robot <zealci@....com.cn>
Subject: Re: [PATCH linux-next] USB: serial: ftdi_sio: remove the unneeded
 result variable

On Mon, Sep 12, 2022 at 04:05:39PM +0200, Greg Kroah-Hartman wrote:
> On Mon, Sep 12, 2022 at 01:38:27PM +0000, cgel.zte@...il.com wrote:
> > From: Xu Panda <xu.panda@....com.cn>
> > 
> > Return the value usb_control_msg() directly instead of storing
> > it in another redundant variable.
> > 
> > Reported-by: Zeal Robot <zealci@....com.cn>
> > Signed-off-by: Xu Panda <xu.panda@....com.cn>

> > -       rv = usb_control_msg(port->serial->dev,
> > -                           usb_sndctrlpipe(port->serial->dev, 0),
> > -                           FTDI_SIO_SET_BAUDRATE_REQUEST,
> > -                           FTDI_SIO_SET_BAUDRATE_REQUEST_TYPE,
> > -                           value, index,
> > -                           NULL, 0, WDR_SHORT_TIMEOUT);
> > -       return rv;
> > +       return usb_control_msg(port->serial->dev,
> > +                              usb_sndctrlpipe(port->serial->dev, 0),
> > +                              FTDI_SIO_SET_BAUDRATE_REQUEST,
> > +                              FTDI_SIO_SET_BAUDRATE_REQUEST_TYPE,
> > +                              value, index,
> > +                              NULL, 0, WDR_SHORT_TIMEOUT);
> >  }
> 
> That's really not the correct use of the return value of
> usb_control_msg().  Can you fix this up to properly handle the return
> value, or better yet, use the usb_control_msg_send() call?

It is actually correct since the buffer length is zero here (i.e. it
returns a negative errno or 0).

But I'm also ignoring patches from this email address as it is used by
multiple users, and of which none so far has replied to feedback (as if
it's all automated).

Johan

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ