All of lore.kernel.org
 help / color / mirror / Atom feed
From: Alan Stern <stern@rowland.harvard.edu>
To: Eugeniu Rosca <erosca@de.adit-jv.com>
Cc: linux-usb@vger.kernel.org, <linux-renesas-soc@vger.kernel.org>,
	<linux-kernel@vger.kernel.org>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Thinh Nguyen <Thinh.Nguyen@synopsys.com>,
	"Lee, Chiasheng" <chiasheng.lee@intel.com>,
	Mathieu Malaterre <malat@debian.org>,
	Kai-Heng Feng <kai.heng.feng@canonical.com>,
	Hardik Gajjar <hgajjar@de.adit-jv.com>, <scan-admin@coverity.com>,
	Eugeniu Rosca <roscaeugeniu@gmail.com>
Subject: Re: [PATCH] usb: hub: Fix unhandled return value of usb_autopm_get_interface()
Date: Tue, 25 Feb 2020 15:54:20 -0500 (EST)	[thread overview]
Message-ID: <Pine.LNX.4.44L0.2002251553030.1485-100000@iolanthe.rowland.org> (raw)
In-Reply-To: <20200225202223.GA9154@lxhi-065.adit-jv.com>

On Tue, 25 Feb 2020, Eugeniu Rosca wrote:

> Hi Alan,
> 
> On Tue, Feb 25, 2020 at 02:39:23PM -0500, Alan Stern wrote:
> > On Tue, 25 Feb 2020, Eugeniu Rosca wrote:
> > > [1] (v5.6-rc3) git grep -En "[^=]\s+usb_autopm_get_interface\("
> > >   drivers/input/touchscreen/usbtouchscreen.c:1788:  usb_autopm_get_interface(intf);
> > >   drivers/media/usb/stkwebcam/stk-webcam.c:628:     usb_autopm_get_interface(dev->interface);
> > >   drivers/net/usb/hso.c:1308:                       usb_autopm_get_interface(serial->parent->interface);
> > >   drivers/net/usb/r8152.c:5231:                     usb_autopm_get_interface(tp->intf);
> > >   sound/usb/usx2y/us122l.c:192:                     usb_autopm_get_interface(iface);
> > 
> > Your regular expression isn't right because it doesn't match lines
> > where the usb_autopm_get_interface() is preceded only by one whitespace
> > character (i.e., a tab).  It also will match lines where there are two
> > space characters between the = sign and the function name.  I think
> > what you want is more like "(^|[^=[:space:]])\s*" at the start of the
> > RE.
> 
> Agreed. My version filters out some true positives.
> 
> > 
> > A revised search finds line 997 in drivers/usb/core/hub.c and lines
> > 216, 269 in drivers/usb/core/port.c.  (I didn't try looking in any
> > other directories.)  AFAICT all three of these should check the return
> > value, although a error message in the kernel log probably isn't
> > needed.
> > 
> > Do you want to fix those instances up also, maybe merging them in with
> > the existing patch?
> 
> I wonder if squashing all these fixes into one patch is the best option.
> 
> There are three commits fixed by the proposed changes in usb core:
>  - v5.6-rc3 commit 1208f9e1d758c9 ("USB: hub: Fix the broken detection of USB3 device in SMSC hub")
>  - v3.9-rc1 commit 971fcd492cebf5 ("usb: add runtime pm support for usb port device")
>  - v2.6.33-rc1 commit 253e05724f9230 ("USB: add a "remove hardware" sysfs attribute")
> 
> I assume a single fix will create some pain when applying it to the
> stable branches. Do you have any preference/inputs about that?

If you prefer to split this up into multiple patches, that's fine with 
me.

Alan Stern


  reply	other threads:[~2020-02-25 20:54 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-25 13:08 [PATCH] usb: hub: Fix unhandled return value of usb_autopm_get_interface() Eugeniu Rosca
2020-02-25 15:32 ` Alan Stern
2020-02-25 19:12   ` Eugeniu Rosca
2020-02-25 19:39     ` Alan Stern
2020-02-25 20:22       ` Eugeniu Rosca
2020-02-25 20:54         ` Alan Stern [this message]
2020-02-26 18:10           ` Eugeniu Rosca

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Pine.LNX.4.44L0.2002251553030.1485-100000@iolanthe.rowland.org \
    --to=stern@rowland.harvard.edu \
    --cc=Thinh.Nguyen@synopsys.com \
    --cc=chiasheng.lee@intel.com \
    --cc=erosca@de.adit-jv.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=hgajjar@de.adit-jv.com \
    --cc=kai.heng.feng@canonical.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-renesas-soc@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=malat@debian.org \
    --cc=roscaeugeniu@gmail.com \
    --cc=scan-admin@coverity.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.