linux-kernel.vger.kernel.org archive mirror
 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-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>,
	Eugeniu Rosca <roscaeugeniu@gmail.com>,
	Hardik Gajjar <hgajjar@de.adit-jv.com>, <stable@vger.kernel.org>,
	<scan-admin@coverity.com>
Subject: Re: [PATCH v3 1/3] usb: core: hub: fix unhandled return by employing a void function
Date: Wed, 26 Feb 2020 13:14:24 -0500 (EST)	[thread overview]
Message-ID: <Pine.LNX.4.44L0.2002261313390.1406-100000@iolanthe.rowland.org> (raw)
In-Reply-To: <20200226175036.14946-1-erosca@de.adit-jv.com>

On Wed, 26 Feb 2020, Eugeniu Rosca wrote:

> Address below Coverity complaint (Feb 25, 2020, 8:06 AM CET):
> 
> *** CID 1458999:  Error handling issues  (CHECKED_RETURN)
> /drivers/usb/core/hub.c: 1869 in hub_probe()
> 1863
> 1864            if (id->driver_info & HUB_QUIRK_CHECK_PORT_AUTOSUSPEND)
> 1865                    hub->quirk_check_port_auto_suspend = 1;
> 1866
> 1867            if (id->driver_info & HUB_QUIRK_DISABLE_AUTOSUSPEND) {
> 1868                    hub->quirk_disable_autosuspend = 1;
>  >>>     CID 1458999:  Error handling issues  (CHECKED_RETURN)
>  >>>     Calling "usb_autopm_get_interface" without checking return value (as is done elsewhere 97 out of 111 times).
> 1869                    usb_autopm_get_interface(intf);
> 1870            }
> 1871
> 1872            if (hub_configure(hub, &desc->endpoint[0].desc) >= 0)
> 1873                    return 0;
> 1874
> 
> Rather than checking the return value of 'usb_autopm_get_interface()',
> switch to the usb_autopm_get_interface_no_resume() API, as per:
> 
> On Tue, Feb 25, 2020 at 10:32:32AM -0500, Alan Stern wrote:
>  ------ 8< ------
>  > This change (i.e. 'ret = usb_autopm_get_interface') is not necessary,
>  > because the resume operation cannot fail at this point (interfaces
>  > are always powered-up during probe). A better solution would be to
>  > call usb_autopm_get_interface_no_resume() instead.
>  ------ 8< ------
> 
> Fixes: 1208f9e1d758c9 ("USB: hub: Fix the broken detection of USB3 device in SMSC hub")
> Cc: Hardik Gajjar <hgajjar@de.adit-jv.com>
> Cc: Alan Stern <stern@rowland.harvard.edu>
> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> Cc: stable@vger.kernel.org # v4.14+
> Reported-by: scan-admin@coverity.com
> Suggested-by: Alan Stern <stern@rowland.harvard.edu>
> Signed-off-by: Eugeniu Rosca <erosca@de.adit-jv.com>

For all three patches:

Acked-by: Alan Stern <stern@rowland.harvard.edu>


  parent reply	other threads:[~2020-02-26 18:14 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-26 17:50 [PATCH v3 1/3] usb: core: hub: fix unhandled return by employing a void function Eugeniu Rosca
2020-02-26 17:50 ` [PATCH v3 2/3] usb: core: hub: do error out if usb_autopm_get_interface() fails Eugeniu Rosca
2020-02-26 17:50 ` [PATCH v3 3/3] usb: core: port: " Eugeniu Rosca
2020-02-26 18:14 ` Alan Stern [this message]
2020-03-03 10:40   ` [PATCH v3 1/3] usb: core: hub: fix unhandled return by employing a void function Eugeniu Rosca
2020-03-03 10:57     ` Greg Kroah-Hartman

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.2002261313390.1406-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-usb@vger.kernel.org \
    --cc=malat@debian.org \
    --cc=roscaeugeniu@gmail.com \
    --cc=scan-admin@coverity.com \
    --cc=stable@vger.kernel.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).