Received: by 2002:ab2:6857:0:b0:1ef:ffd0:ce49 with SMTP id l23csp2380355lqp; Sun, 24 Mar 2024 16:51:21 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCW71qVdAaqBdrFkpzvWC3opEUBiekPT5Z/ybHl6NHmsCRXEcLzUM8DFQCOYwa8sOBMXjWNHVwGlLUcLTl1MiAxXTOkNIato3u27r5BMNg== X-Google-Smtp-Source: AGHT+IEG1Py96/IZngQREi//G9S7jtzVoTFJpibC4mDqUdCpV1e0YJyiVziMZXEOE4qdESdXJCLW X-Received: by 2002:a05:622a:1387:b0:431:14a9:1965 with SMTP id o7-20020a05622a138700b0043114a91965mr7857857qtk.27.1711324280988; Sun, 24 Mar 2024 16:51:20 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711324280; cv=pass; d=google.com; s=arc-20160816; b=Agq/mQaUB/MLfQTZoIRdnHksLYzSG8/x+p/dW2RWYUjbMHmhLAhJMk/D5Xx6Wjm1Nz gzzHuI4YK5ZlsJIEC7MDDIiz4pW8ZmegoL6l8qQ+OSoOdM22acxEukgtXAJi2dO7evfU KTawWtMSIobK8nWJki9T9+vux28AAnJrpz0BozAYvBzYL1jIipGqSqcFwzDr6XapAc/1 Yy6We104ebdSNDG8QP/chshozIuTF9hieWAC298TnQcXtDb7BbjdxzeEoQ0DrpZa547U EeUhk6/c8RBxxJKJFv5N+EkJp37XZ4wEOu8dvPWk02+Dh1oQTUNcMjjhng6kRWfrZwKy x+dg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=Vp6bougy2Al3v6CUNXZCy3cSmql/f+4FBlxG3alV8l8=; fh=IVf2+V47FlP8uiHrrULqR508VFOLl2wS4zP5fcQUboc=; b=k4Q6YhFHq+DLIp9DOogpJdEK3EMjJb+zUJYf5i/OsBlvN8nlcnmqmRKRg0X4tvXqm8 JLoffq4jQE5ZBIMRGg6gAmcUiIFLLeF+5rDX2h8EzOgl3mpsJFLD/pMkhFDTKX/VCXSW 1mTqTMJOOalcG9BbpMbD2AyqRMCEH1Gt/ktzqReOPub3dCDV2OIJX63nDniK+bh5gf8m 2WSuoVPrrvkdXsvm024MwR4Q12ipNaMnfvwvwp0fi8hcxrM8S74ZvbJ0AzePAA1PMwlo S2AIwuDsF1NbC4KWGIU0CwhVJZFRw1txKxKJMKcwBpjo0QNa+nQwmJLx0dLLFdnb+y+w whlg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="Ed1B3//0"; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-113235-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-113235-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id y20-20020a05622a005400b0043114a8ef9csi4274002qtw.633.2024.03.24.16.51.20 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 24 Mar 2024 16:51:20 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-113235-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="Ed1B3//0"; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-113235-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-113235-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id B155C1C22B11 for ; Sun, 24 Mar 2024 23:51:20 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 0D5E4184326; Sun, 24 Mar 2024 22:40:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="Ed1B3//0" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 079EA184308; Sun, 24 Mar 2024 22:40:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711320036; cv=none; b=II5tCYyCRpvW/oqfABB4QkuUPPTl9khPWWGNtdaxz+V4ZXca2MMAQbbh5ubl+PVJc4Ql9a7BHPVtu5hpUFUA8QuUcPqnZciStX9txldZ4WFoGYZelAnx+clhNbFtN7rwir+5D5GDLjARSvcRkHGY4rztYnydvahqCHPjeJaaa+A= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711320036; c=relaxed/simple; bh=FPBnRQhKMIBc/J0qBo7uQGtzOxuQ2Val9MKzDoQgzUo=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=JlRG3UH5AG3I/pab28psBCO+dr4CL9tIV66bURdaeodTzxjg9fqxLbWXnHGXkNaVkRxiauwUY2pl5vhbHvjO1KWtCYx2DBKnGbFaBO8UPvVj9ETtsNODdQsehXuHdUpfj99tjbZZtYUJr9U+XttP5ufkwhl38Xf5dSMK412oRY8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=Ed1B3//0; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 38714C433A6; Sun, 24 Mar 2024 22:40:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1711320035; bh=FPBnRQhKMIBc/J0qBo7uQGtzOxuQ2Val9MKzDoQgzUo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Ed1B3//0d5zhR3A+Znr5aoOgBuYZxlQb2DGCejR/BRDlIitfW0irSmP9qpHXSbWxH K177OcfQmmwn0MQ1lPtnzg8nlnvg/IwH2EPS/1cGTf4RHrXKvpIxlwdxM1MSTv53YJ 8utEaFzxJVanesvyGwa1uhvX4V5Ax5zEQWucePPk9dbvFsX2Zx1MyKr7sTwCPqHF++ SGCpSBpWH8Bz8yulGXiVZ/i2seL3+9MLW4aBlp04cHQmMuvbkmjvCRiej5w2R08D6y G+AsrhZKJMd2Um/+uaGHJ9A79Tb6qxAICFIwfjKjg0IadevkWrj3EbQbtTX9OZjJHY SXqS9GNooveJA== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Hayes Wang , Jakub Kicinski , Sasha Levin Subject: [PATCH 6.8 344/715] r8152: fix unknown device for choose_configuration Date: Sun, 24 Mar 2024 18:28:43 -0400 Message-ID: <20240324223455.1342824-345-sashal@kernel.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240324223455.1342824-1-sashal@kernel.org> References: <20240324223455.1342824-1-sashal@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit From: Hayes Wang [ Upstream commit 46590b545df636aea0f9f7f2100d9963c0af5824 ] For the unknown device, rtl8152_cfgselector_choose_configuration() should return a negative value. Then, usb_choose_configuration() would set a configuration for CDC ECM or NCM mode. Otherwise, there is no usb interface driver for the device. Fixes: aa4f2b3e418e ("r8152: Choose our USB config with choose_configuration() rather than probe()") Signed-off-by: Hayes Wang Link: https://lore.kernel.org/r/20240308075206.33553-436-nic_swsd@realtek.com Signed-off-by: Jakub Kicinski Signed-off-by: Sasha Levin --- drivers/net/usb/r8152.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/usb/r8152.c b/drivers/net/usb/r8152.c index 0d0672d2a6545..51fe00c2b896e 100644 --- a/drivers/net/usb/r8152.c +++ b/drivers/net/usb/r8152.c @@ -10078,7 +10078,7 @@ static int rtl8152_cfgselector_choose_configuration(struct usb_device *udev) * driver supports it. */ if (__rtl_get_hw_ver(udev) == RTL_VER_UNKNOWN) - return 0; + return -ENODEV; /* The vendor mode is not always config #1, so to find it out. */ c = udev->config; -- 2.43.0