From nobody Sat Nov 23 23:54:32 2024 Received: from HK3PR03CU002.outbound.protection.outlook.com (mail-eastasiaazon11021097.outbound.protection.outlook.com [52.101.129.97]) (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 D7D2219259F; Fri, 8 Nov 2024 09:43:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=52.101.129.97 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1731059014; cv=fail; b=GJ93701S11pXVXEn/QnSvATeWvU+p+92aX546RMmrJhDd+sIEIkqXH2NJgFRJT7SjTgn8M+S7qYvFqum2XjAcM09ahMaWz3gU6nEaFEZsJbxrZwy9SPR47ByUzBCBSuwZuhrpLcR+PCA04zUyqiGY+9AH8t1Hc45cIj/nvoG8u0= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1731059014; c=relaxed/simple; bh=58oMrU8k7+lMiUYFm2l4X8ULOOv0bt7+DT7rM5/Wgks=; h=From:To:Cc:Subject:Date:Message-Id:Content-Type:MIME-Version; b=LClJs2YHXLfLkSYLaMV4EyfCaynuvuekPDg5oyM/2Cci/jv872jFCjBAFfs3kRNGbyhp9njQBOrckvdQESn5FGHT9P+bis85lWO12Pn8LYca/VVCzPResYP6mneeOh6i6azCYTDHhs7bv2YOGo3WZ3RgPk02yuDTenzJOP7rYWU= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=jaguarmicro.com; spf=pass smtp.mailfrom=jaguarmicro.com; dkim=pass (2048-bit key) header.d=jaguarmicro.com header.i=@jaguarmicro.com header.b=RGO7uzB9; arc=fail smtp.client-ip=52.101.129.97 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=jaguarmicro.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=jaguarmicro.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=jaguarmicro.com header.i=@jaguarmicro.com header.b="RGO7uzB9" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=NpnM2nJbBY7hMOR3qt+2sBV23hha9jO529jO4Iz1kr/r465mk3dsrFpdNKKz8iHRBGFyzQFffXuTdl2cWuIcplHVMVPLAox4gBTRwoynMR+73VDm9CwHpaBjTf63YVT0f2Kj84KqPfeQFfbMal4ntA9W4LENoOY1tYU1wK/tr31oeDRWcnMMrcWJj0x1UFbrZTtCjurizibU3XKCI5d4AMDyP2mXyAajSqk0ZL8e+ccwPheTzTrTuCcSl85iphICt/owwUmh96rKVUujafHZVqDL2TPxh+Gv9UWVwQCysqpgEbWFCWOjowdZnJo4lWSpn9lm1iYWBB3EU2M0YRMAZw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=l43zYyZTj1cDtEQYDefaWyfOSzDF7u7bOiidmzzcZ0E=; b=v/2LHB48d+7hPm6a/nS5T3HErjjhoDofvWAWEtPgIbd+x/pWbhLhPgAEJvsyCwtkXX2frQq/z6mlhjxC16DjKfcUSxW/lq4w7v6KI8IHaHyHg2n3GQUydfCp999PLhlh35wn2EB6nb3EMz2J3kw+WOfBEitOJabd24jucGcNA49+sa3p6x09G98G1nMhUCh5tp25mm6B2jKWnbzC9v5mi7F3crZfKJBnRHn8hZ6WC5IZUy0iu9JCmIQ98HbQmthlevx1mdrJqQWJ61sSr87qfeXnX0zBLEcAlHbYGhRv5F3ffoQj2HS1ssS3USeEk9I6UneuHE3Jr/ZTieA4vIWc5Q== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=jaguarmicro.com; dmarc=pass action=none header.from=jaguarmicro.com; dkim=pass header.d=jaguarmicro.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=jaguarmicro.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=l43zYyZTj1cDtEQYDefaWyfOSzDF7u7bOiidmzzcZ0E=; b=RGO7uzB9xUKn4Kw7Df69IE+J4lXNxrMnnjcgG5OvfcwsuNlOfbXF4I4Ju4Cw2H+NFu8bE5eM/nEBEfsUxSmLeQrtZMSl8sxmcL9JHTRCjnPrf10mLwhDLbwvC5YatWAYZxkPTu+VqEekEgENF+aGncnnm+T8nxeCRsp3hkAv6xTPF3Vm3h/FPZxC3X/MAzZkxrIR6F7wK2P4iXY4dpj7CW2BRmMHewFrBHeLuqs00W5IHtp7wOtT1pnvWmz1rJeA4d2j9CeyQkh/6wNNlJwgi2XV82wjU7TuqnhHnBHl6/QqmPn53o4Tai7WAE2uYbDJyvM5I2hdlZ1pBWQ9S68sfw== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=jaguarmicro.com; Received: from KL1PR0601MB5773.apcprd06.prod.outlook.com (2603:1096:820:b1::13) by TYUPR06MB6121.apcprd06.prod.outlook.com (2603:1096:400:351::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8093.16; Fri, 8 Nov 2024 09:43:25 +0000 Received: from KL1PR0601MB5773.apcprd06.prod.outlook.com ([fe80::b56a:3ef:aa9d:c82]) by KL1PR0601MB5773.apcprd06.prod.outlook.com ([fe80::b56a:3ef:aa9d:c82%4]) with mapi id 15.20.8137.018; Fri, 8 Nov 2024 09:43:25 +0000 From: Rex Nie To: gregkh@linuxfoundation.org Cc: linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, angus.chen@jaguarmicro.com, stable@vger.kernel.org, Rex Nie Subject: [PATCH] USB: core: remove dead code in do_proc_bulk() Date: Fri, 8 Nov 2024 17:42:55 +0800 Message-Id: <20241108094255.2133-1-rex.nie@jaguarmicro.com> X-Mailer: git-send-email 2.39.0.windows.2 Content-Transfer-Encoding: quoted-printable X-ClientProxiedBy: SI1PR02CA0033.apcprd02.prod.outlook.com (2603:1096:4:1f6::14) To KL1PR0601MB5773.apcprd06.prod.outlook.com (2603:1096:820:b1::13) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: KL1PR0601MB5773:EE_|TYUPR06MB6121:EE_ X-MS-Office365-Filtering-Correlation-Id: de7ba735-2059-42e2-9250-08dcffd9ca4e X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|1800799024|366016|376014|52116014|38350700014; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?yD/SFXW+/TURzNbhYpMJ/LYgBKFHEMYH+I4lxWD52z4WpfjcHvK0GwQWO5wk?= =?us-ascii?Q?ZdhFjL4GFUpEghLnYLpKsteDce1KJdHWVzRmt22kYoVMIK9e36aFm8GodMpG?= =?us-ascii?Q?O/3DE1OTlsLlHrV5PyHGpYiM46XBRyq9Zv1U0Su5bYpVIXnLzLVjqYj1KA9N?= =?us-ascii?Q?am+P2gRxq9hNjUm8wLwK6GkyTUQrcM2nS4zUHkbUQLZOgiP6qdnFv0BH2XwS?= =?us-ascii?Q?chcR2nlZSTMDglQPGkeTFguhn3NPSUg4CKW6m8F1GhKjlptDaTbz5G7FAPiZ?= =?us-ascii?Q?hyJmnZuLKcz915Nwlna1MjcOSjElA12hZqiePpVy8e6T+0tr0gIog0YcucOX?= =?us-ascii?Q?MbjKBEhVevpLfdp49ICxQlHb03RfL61cHOM9Ozx5XqYDq2BQmbBtPAc1aC4k?= =?us-ascii?Q?JdOgqfXg8n+IG5G5I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=?us-ascii?Q?tJ9FO1yATtqLnUUXYy1/QMGIPhEaH19GunMTHqB2FWE/DjvHQrQ2iZFjmFkD?= =?us-ascii?Q?5ja2bws=3D?= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:KL1PR0601MB5773.apcprd06.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(1800799024)(366016)(376014)(52116014)(38350700014);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?GI7Pa1jhhotAZ+bSjSDam9OL8sp72ojSrfIIXPA+hSUuLdqKn//kTODq4gfp?= =?us-ascii?Q?FwAoMrlWjV0iPJb8cy3i5aAUaQQ/juFo2TILz+T/I74Cvph5TLdTk50CKzYB?= =?us-ascii?Q?9ucKqxVUcQwVKrSWzRg/PXu3GBl2BQIm3GtyKecoMdCp9V3dU3hCmjL9t20s?= =?us-ascii?Q?/+EC3FHcldHvK4sCl+gwXi929sKkekMi2IKjEZc9fhEX3cdTk5rWBOHfCMkC?= =?us-ascii?Q?WL+sd/4zc9L2DR36pLoLI4xsx4QNqYyZ/336tysOzVQmdlz6k9Nru8OiwgEV?= =?us-ascii?Q?2BS5PWGjnN4Ma6BLeu91aARzkIRMSIIbWC95MHazECoQlHWY6CUarAhojW1X?= =?us-ascii?Q?l9UdQD09mCsc2kFRU5Q++jsZUa4erzMlYt1x/JgDe9SM3R6YtSDH9kDKa5Ib?= =?us-ascii?Q?ORtx8ESo4n6Bp4RQiTugWCxAKj89GCvJjLW9v4kIcnofH8UXGDtkHARYaHym?= =?us-ascii?Q?vRwmLgHitgCXXgX7uR4BDxS1yHIDLleh7D8FzDY9aox7/NcH9JB+64jcyvGH?= =?us-ascii?Q?B6Xx1KcXCNLr0tUvLW+YLh3mOfOGZ4jE9+k1FhDWqJnDdV4OSvmFEgbnxDzf?= =?us-ascii?Q?RO/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E9Ic?= =?us-ascii?Q?T5cJpDnpA6ILADcJdvE9/tstOrH7oYMhUJKF8jOEI3S/z7j3KQULrcI1LPGW?= =?us-ascii?Q?pxs7f3cyiPICJ0zS8OKudnJHJ18boQufatbyONGLB0EPIoZ5GNrd0DXJgrxc?= =?us-ascii?Q?bg=3D=3D?= X-OriginatorOrg: jaguarmicro.com X-MS-Exchange-CrossTenant-Network-Message-Id: de7ba735-2059-42e2-9250-08dcffd9ca4e X-MS-Exchange-CrossTenant-AuthSource: KL1PR0601MB5773.apcprd06.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Nov 2024 09:43:24.9456 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 1e45a5c2-d3e1-46b3-a0e6-c5ebf6d8ba7b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 8rCBXEf2pb1DaqjV6m9vsotVJ8eb/gIzDXHiLZGqVBsa0IsJY6mEQsHG7/vh8eBBIvz6IktNbHTOExzENk32KA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: TYUPR06MB6121 Content-Type: text/plain; charset="utf-8" Since len1 is unsigned int, len1 < 0 always false. Remove it keep code simple. Signed-off-by: Rex Nie Acked-by: Alan Stern --- drivers/usb/core/devio.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/usb/core/devio.c b/drivers/usb/core/devio.c index 3beb6a862e80..712e290bab04 100644 --- a/drivers/usb/core/devio.c +++ b/drivers/usb/core/devio.c @@ -1295,7 +1295,7 @@ static int do_proc_bulk(struct usb_dev_state *ps, return ret; =20 len1 =3D bulk->len; - if (len1 < 0 || len1 >=3D (INT_MAX - sizeof(struct urb))) + if (len1 >=3D (INT_MAX - sizeof(struct urb))) return -EINVAL; =20 if (bulk->ep & USB_DIR_IN) --=20 2.17.1