Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp2816567pxb; Mon, 1 Nov 2021 02:23:28 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzlVmWBjcbk2L3+1VrFQsx+MUcLGE+C6QxDQ/mU9tD9bO4MYv7SJiAHGmNanRQSlnl5mG8N X-Received: by 2002:a05:6602:29c7:: with SMTP id z7mr20318592ioq.93.1635758607907; Mon, 01 Nov 2021 02:23:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1635758607; cv=none; d=google.com; s=arc-20160816; b=fsINHWuGJgdZyz00ejjMVx5Vd2jhV8bZU8Ia4JCgPyw9vYkxLeSoZfTtkbK0Bk5iMK RSbayI8CHHYVpvZdJVViIKyEecDKBLKBXyolWWa2pmoPNlrzjwTW837ynZRJswrJvboh YXvwyTsg/h3UCU4MEsVoxL/hJoDqGDu3IjoO91JFH0Xl4OqQbe8AdUOZRVciO/LOLR1R gK73/s2yy+QEg7zjLKUwDVJc9lwYP1+3/hAtneklJ3DHdAMO3aweKXd/Pm6ZAdE/pSH6 B9eu7zw03ftDlOZIetYBVwzmaSqslMwV3G4nGGbxXGkIo7DwS3pkh5FsD0zcewH9Fx46 6cQg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=dQAwMK+D4uMTuoR7g7jm+Kle+yIAKtiYeuKBJwwe+dE=; b=Qi5AUAYJYvYqx8w+Ill7hbkUg4MnM1EI0ezlcw/ITaS/oXK9utLR9rMlGv2qDCZzQK rs1P2OijgbiwoY3FEpJW7i2TYvIIscPWs1Y+UEPjvwiLtQjow8caO+HLh3/RsFIDQ0sp qkXJ8TnPZMuV4w3+MznzbRjytECFSUSHfkqrklcUQDWhSKbf04MAuqD5hA1GOjbapd9H Rlcs8+98vNUMIkZV4C8t8Mus15aekzRik6I0s2NKQfHM8UdUkL7xeZqX3jmNPaekbVKg 4UPGbst2iuCNBLadEr2ox7q0mlrKq7UmVawxbepzT629TBFZqLWf2pCxvSOQyTw8WzIw CgPw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=lLKmrwo1; 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=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id j13si990916ilu.121.2021.11.01.02.23.16; Mon, 01 Nov 2021 02:23:27 -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=@linuxfoundation.org header.s=korg header.b=lLKmrwo1; 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=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232565AbhKAJXz (ORCPT + 99 others); Mon, 1 Nov 2021 05:23:55 -0400 Received: from mail.kernel.org ([198.145.29.99]:58248 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232284AbhKAJWi (ORCPT ); Mon, 1 Nov 2021 05:22:38 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 5C67761179; Mon, 1 Nov 2021 09:19:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1635758394; bh=Sal7EXgUueWRxWeko37X1V1bBDOT8ItcE49Zb/dJ8sg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=lLKmrwo1/nHv02prLgBtSspb6uEKHojfcTkr1mE+kM7V5CxUSoC0sH5oZDnR2CPyK EH48EShMifa2xvZvmw9vkXibuNGzHrIfLFO7dFLCfS1sQ4dR7UHx05UsL0zi0bCpKN jxok8TyLtLH9sIoXr1QvPMlR+G5Uczwo/UVaSKXw= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Hulk Robot , Wang Hai , Johan Hovold , Jakub Kicinski Subject: [PATCH 4.9 07/20] usbnet: fix error return code in usbnet_probe() Date: Mon, 1 Nov 2021 10:17:16 +0100 Message-Id: <20211101082445.753125621@linuxfoundation.org> X-Mailer: git-send-email 2.33.1 In-Reply-To: <20211101082444.133899096@linuxfoundation.org> References: <20211101082444.133899096@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Wang Hai commit 6f7c88691191e6c52ef2543d6f1da8d360b27a24 upstream. 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 Reviewed-by: Johan Hovold Link: https://lore.kernel.org/r/20211026124015.3025136-1-wanghai38@huawei.com Signed-off-by: Jakub Kicinski Signed-off-by: Greg Kroah-Hartman --- drivers/net/usb/usbnet.c | 1 + 1 file changed, 1 insertion(+) --- a/drivers/net/usb/usbnet.c +++ b/drivers/net/usb/usbnet.c @@ -1742,6 +1742,7 @@ usbnet_probe (struct usb_interface *udev dev->maxpacket = usb_maxpacket (dev->udev, dev->out, 1); if (dev->maxpacket == 0) { /* that is a broken device */ + status = -ENODEV; goto out4; }