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: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Pine.LNX.4.44L0.1702131142520.1905-100000@iolanthe.rowland.org>
Date:   Mon, 13 Feb 2017 11:45:31 -0500 (EST)
From:   Alan Stern <stern@...land.harvard.edu>
To:     Felipe Balbi <felipe.balbi@...ux.intel.com>
cc:     Colin King <colin.king@...onical.com>,
        Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
        Peter Chen <peter.chen@....com>,
        Mathias Nyman <mathias.nyman@...ux.intel.com>,
        Lu Baolu <baolu.lu@...ux.intel.com>,
        Chunfeng Yun <chunfeng.yun@...iatek.com>,
        <linux-usb@...r.kernel.org>, <kernel-janitors@...r.kernel.org>,
        <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] usb: misc: usbtest: remove redundant check on retval <
 0

On Mon, 13 Feb 2017, Felipe Balbi wrote:

> Hi,
> 
> Colin King <colin.king@...onical.com> writes:
> > From: Colin Ian King <colin.king@...onical.com>
> >
> > The check for retval being less than zero is always true since
> > retval equal to -EPIPE at that point.  Replace the existing
> > conditional with just return retval.
> >
> > Detected with CoverityScan, CID#114349 ("Logically dead code")
> >
> > Signed-off-by: Colin Ian King <colin.king@...onical.com>
> > ---
> >  drivers/usb/misc/usbtest.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/drivers/usb/misc/usbtest.c b/drivers/usb/misc/usbtest.c
> > index 3525626..17c0810 100644
> > --- a/drivers/usb/misc/usbtest.c
> > +++ b/drivers/usb/misc/usbtest.c
> > @@ -992,7 +992,7 @@ static int ch9_postconfig(struct usbtest_dev *dev)
> >  				dev_err(&iface->dev,
> >  						"hs dev qualifier --> %d\n",
> >  						retval);
> > -				return (retval < 0) ? retval : -EDOM;
> > +				return retval;
> 
> you're changing return value here, are you sure there's nothing else
> depending on this error?

I bet you didn't look at the original code.  :-)  Just before the start
of the patch there is:

		if (retval == -EPIPE) {
			...

So no, the patch does not change the return value.

Alan Stern

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ