netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Johan Hovold <johan@kernel.org>
To: Wang Hai <wanghai38@huawei.com>
Cc: oneukum@suse.com, davem@davemloft.net, kuba@kernel.org,
	netdev@vger.kernel.org, linux-usb@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH net v2] usbnet: fix error return code in usbnet_probe()
Date: Tue, 26 Oct 2021 14:30:37 +0200	[thread overview]
Message-ID: <YXf07WrHVwk8WF2B@hovoldconsulting.com> (raw)
In-Reply-To: <20211026124015.3025136-1-wanghai38@huawei.com>

On Tue, Oct 26, 2021 at 08:40:15PM +0800, Wang Hai wrote:
> Return error code if usb_maxpacket() returns 0 in usbnet_probe()
> 
> Fixes: 397430b50a36 ("usbnet: sanity check for maxpacket")
> Reported-by: Hulk Robot <hulkci@huawei.com>
> Signed-off-by: Wang Hai <wanghai38@huawei.com>

This needs to go to stable as well as the offending patch is being
backported.

Cc: stable@vger.kernel.org
Reviewed-by: Johan Hovold <johan@kernel.org>

> ---
> v1->v2: change '-EINVAL' to '-ENODEV'
>  drivers/net/usb/usbnet.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/net/usb/usbnet.c b/drivers/net/usb/usbnet.c
> index 80432ee0ce69..a33d7fb82a00 100644
> --- a/drivers/net/usb/usbnet.c
> +++ b/drivers/net/usb/usbnet.c
> @@ -1790,6 +1790,7 @@ usbnet_probe (struct usb_interface *udev, const struct usb_device_id *prod)
>  	dev->maxpacket = usb_maxpacket (dev->udev, dev->out, 1);
>  	if (dev->maxpacket == 0) {
>  		/* that is a broken device */
> +		status = -ENODEV;
>  		goto out4;
>  	}

Johan

  reply	other threads:[~2021-10-26 12:30 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-26 12:40 [PATCH net v2] usbnet: fix error return code in usbnet_probe() Wang Hai
2021-10-26 12:30 ` Johan Hovold [this message]
2021-10-27 19:20 ` patchwork-bot+netdevbpf

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=YXf07WrHVwk8WF2B@hovoldconsulting.com \
    --to=johan@kernel.org \
    --cc=davem@davemloft.net \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=oneukum@suse.com \
    --cc=wanghai38@huawei.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 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).