Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp1469730pxb; Tue, 26 Oct 2021 09:33:26 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwbTowzF9Lmdz3yuExVHGodgO1N/HM6uVATT8KIBH65i6kalB7VQr7rlzKOaRDf4O1NYK+X X-Received: by 2002:aa7:d54e:: with SMTP id u14mr36596015edr.2.1635266006680; Tue, 26 Oct 2021 09:33:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1635266006; cv=none; d=google.com; s=arc-20160816; b=DbyF8aQ2myirOuSB77BUrFHtAtxrdy82iRx3xWS5rwifCfWRyl73B8P4Afx7azDIIM 3lg+bkr4FhX0KLkjo+sHz4sb+CMtWBFR1eamPiQth61C22j6hYXBE/Vm6YiQQ+7BXUJQ gtCpSxdTrxdEQtt7v+j9etCqaUkLVqVBnuz0UQR2q603rUkH3Bx7jcPZtt6FYTjWd3Mp 2B6fUVkjZscS3L71Dykb8Olb6Ng0yNulIg9Gp16EwEcaosLPROeJrkCu4fKqnR7Mivyu ulOn7/rFSNQEkz8jP2S9e6BhxWP/ERcvOdElP8KAFQwwPLxQs0CfZPu3/5SCHfRMOnuQ ylRA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=hVlbnQP3JaFW9YVbVZi3bgWWKNycdp44fJI0UeuMnqY=; b=UXWz2UzZOBRHSBIcD4vKVipdkt3TDKDoTf9VzXdaSofCYinG7J+Om42i/3XZsie8AN L2bCV5cbQ6mIO/mQ1yn03D+eliiXIq1TUKeJWL+uHZvlsjSMW+2kWho7yM98h6E1it+z ZAD+cNWmLdgOMLvQ3E0dIR0BXTups0YZPHaf6pCoTr0q1t51MaZZ7nlh9c+ukPduvx4a qsG0VAqXsUMH8+IpgELDhMBxkpvbsVF5W+dK9xHM9nKsvn6adtBbZRI+gbwSGMPq/mZ5 BAnthLt7PuV8cf7H6QFTKlRdOv47/DVBDwZ66LCOdazCDrEU1Q93odWoiK/lD4lssUTN HPEw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=LPtaD8PA; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id p4si32685494eju.288.2021.10.26.09.32.49; Tue, 26 Oct 2021 09:33:26 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=LPtaD8PA; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235974AbhJZMdS (ORCPT + 99 others); Tue, 26 Oct 2021 08:33:18 -0400 Received: from mail.kernel.org ([198.145.29.99]:45700 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235425AbhJZMdS (ORCPT ); Tue, 26 Oct 2021 08:33:18 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 5394960EBD; Tue, 26 Oct 2021 12:30:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1635251454; bh=Sjf7b/oeWGiONyuawgadmBHHVmuErKfTpBabVyn5MPQ=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=LPtaD8PAqJ645wMcl9R83O49m5Eo8JqJYW4TP1jHM0+4L1ODZsjyh3B4Kue6MglMu 5+sTKd/xW7bNhfpInnlSbZabnai2u5Hz9jX0X5nFA4vxEZ/3hamuafbWqyrBLdhbhm zWDLrrtFGPavjQf+EoTOh66VHUx3JhVUkGkhvsOsBntvYB4C+swA9dKXr2QYnatapo k8/fSk63lb6XO1BH97qxxW0ni8cnsEofqXDNP1d53UJ1EpBT0fU2+6G5VE8LW2F8k2 I0HG0cIdfNndlfizE8VN/bLQ81usn6UJcBXWxt6Iqb8O5X0R23eevsqvNSZuv/L7qB 70xtS9eEskPqw== Received: from johan by xi.lan with local (Exim 4.94.2) (envelope-from ) id 1mfLbB-0001iB-JL; Tue, 26 Oct 2021 14:30:38 +0200 Date: Tue, 26 Oct 2021 14:30:37 +0200 From: Johan Hovold To: Wang Hai 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() Message-ID: References: <20211026124015.3025136-1-wanghai38@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20211026124015.3025136-1-wanghai38@huawei.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 > Signed-off-by: Wang Hai This needs to go to stable as well as the offending patch is being backported. Cc: stable@vger.kernel.org Reviewed-by: Johan Hovold > --- > 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