Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp5476916pxb; Wed, 26 Jan 2022 12:58:08 -0800 (PST) X-Google-Smtp-Source: ABdhPJx1vwKbE/3FzqUB6osbBHbe3Lo96aY6ZbF9tTCsHkvvjJA8ELFc4dUMhRjZHW9cBTTWxDVM X-Received: by 2002:a17:907:6298:: with SMTP id nd24mr495428ejc.76.1643230688275; Wed, 26 Jan 2022 12:58:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643230688; cv=none; d=google.com; s=arc-20160816; b=WKSTcDYrB5ImiVkjNK8rEea3e39ev9fanV+te42OdIc3KRVrdCnMvhAoTC6TDwKis0 aFmT4dddj0/QzXm8gWZVt4knQvpL4rMIHrwO7dIzXwZ6nzGLA1eWm0UMZE25h6Wu+K2f P0T+XwdHrMHKil2lXb+vi1/4DikPUHnC+xkIh/i15uORcAdQFOiA6PeDXPKHwFlctsRj 7R0iBvpizwOIi8OqL6BOxE9YeJtE9UpZJjbCcx4BPgMJzpYc9TeUOeq5NMZKLsRicuLg sA/l2wGNLU46DFFdmdRT4XQ93X79j1z7t/xnsD2Yi5AF3+O32zNwBm//hsRs1zMd2L0C camw== 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 :message-id:date:subject:cc:to:from; bh=XZDBlY5FksCHwqAqJLg8Jkp/n3s90WG470FYNWDqwt8=; b=DDzkBxpltMzhhhdrwzXflbA7nqyNCMqNltQrCj4nDLUOX3Bh5kSmG1hD12Pb3kQGrq TUDkY8yObF9uUMpLBF8jhG2dRKrVv1REq1WNyrOmtgVlaa1QG6kYx8pCDEtvYTBqhAmN D7sPO/93RYYP5WU+hn6yuH9sjCGO3YFAjvKjiKMzaKHUwbYWMRTrMsQkyW58Xw/Nj7wr qhpmfqSYF/kuBM1cWQkzhW4tugSSwgR9WMGPDDfH6AD/f7ppcmt+E4mXOJa+AcINx6nt wPhRMtALHzeoax1zs3FwNI0UAj3jlbOdDiQRCr0303Ws0PPcWMA5Aa56bwtx4yKd74Tu YJNQ== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id cw1si190556ejc.281.2022.01.26.12.57.42; Wed, 26 Jan 2022 12:58:08 -0800 (PST) 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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239661AbiAZKJ4 (ORCPT + 99 others); Wed, 26 Jan 2022 05:09:56 -0500 Received: from twspam01.aspeedtech.com ([211.20.114.71]:19548 "EHLO twspam01.aspeedtech.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232350AbiAZKJz (ORCPT ); Wed, 26 Jan 2022 05:09:55 -0500 Received: from mail.aspeedtech.com ([192.168.0.24]) by twspam01.aspeedtech.com with ESMTP id 20QA1cXh035874; Wed, 26 Jan 2022 18:01:38 +0800 (GMT-8) (envelope-from neal_liu@aspeedtech.com) Received: from localhost.localdomain (192.168.10.10) by TWMBX02.aspeed.com (192.168.0.24) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Wed, 26 Jan 2022 18:09:02 +0800 From: Neal Liu To: Felipe Balbi , Greg Kroah-Hartman , Alan Stern , "Chen Lin" , Wesley Cheng , "Nikita Yushchenko" , Cai Huoqing , , , CC: Neal Liu , Subject: [PATCH] usb: gadget: mass_storage: add READ_TOC cmd mask check Date: Wed, 26 Jan 2022 18:08:56 +0800 Message-ID: <20220126100856.3680716-1-neal_liu@aspeedtech.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII X-Originating-IP: [192.168.10.10] X-ClientProxiedBy: TWMBX02.aspeed.com (192.168.0.24) To TWMBX02.aspeed.com (192.168.0.24) X-DNSRBL: X-MAIL: twspam01.aspeedtech.com 20QA1cXh035874 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org READ_TOC cmnd[2] specifies Format Field which is defined in SCSI-3 spec. Add command mask to avoid marking this sense data as invalid. Signed-off-by: Neal Liu --- drivers/usb/gadget/function/f_mass_storage.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/usb/gadget/function/f_mass_storage.c b/drivers/usb/gadget/function/f_mass_storage.c index 46dd11dcb3a8..14d51695b8ae 100644 --- a/drivers/usb/gadget/function/f_mass_storage.c +++ b/drivers/usb/gadget/function/f_mass_storage.c @@ -1944,7 +1944,7 @@ static int do_scsi_command(struct fsg_common *common) common->data_size_from_cmnd = get_unaligned_be16(&common->cmnd[7]); reply = check_command(common, 10, DATA_DIR_TO_HOST, - (7<<6) | (1<<1), 1, + (7<<6) | (1<<1) | (1<<2), 1, "READ TOC"); if (reply == 0) reply = do_read_toc(common, bh); -- 2.25.1