linux-usb.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: Neal Liu <neal_liu@aspeedtech.com>
Cc: Felipe Balbi <balbi@kernel.org>,
	Alan Stern <stern@rowland.harvard.edu>,
	Chen Lin <chen.lin5@zte.com.cn>,
	Wesley Cheng <quic_wcheng@quicinc.com>,
	Nikita Yushchenko <nikita.yoush@cogentembedded.com>,
	Cai Huoqing <caihuoqing@baidu.com>,
	linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-aspeed@lists.ozlabs.org, BMC-SW@aspeedtech.com
Subject: Re: [PATCH] usb: gadget: mass_storage: add READ_TOC cmd mask check
Date: Wed, 26 Jan 2022 11:51:09 +0100	[thread overview]
Message-ID: <YfEnnWuL1cC6airb@kroah.com> (raw)
In-Reply-To: <20220126100856.3680716-1-neal_liu@aspeedtech.com>

On Wed, Jan 26, 2022 at 06:08:56PM +0800, Neal Liu wrote:
> 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 <neal_liu@aspeedtech.com>
> ---
>  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,

Can we have real names here instead of magic numbers?

And what commit does this fix?  Is it a regression or has it always
never worked properly?

thanks,

greg k-h

  reply	other threads:[~2022-01-26 10:51 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-26 10:08 [PATCH] usb: gadget: mass_storage: add READ_TOC cmd mask check Neal Liu
2022-01-26 10:51 ` Greg Kroah-Hartman [this message]
2022-01-27  2:11   ` Neal Liu
2022-01-26 16:00 ` Alan Stern
2022-01-27  2:11   ` Neal Liu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=YfEnnWuL1cC6airb@kroah.com \
    --to=gregkh@linuxfoundation.org \
    --cc=BMC-SW@aspeedtech.com \
    --cc=balbi@kernel.org \
    --cc=caihuoqing@baidu.com \
    --cc=chen.lin5@zte.com.cn \
    --cc=linux-aspeed@lists.ozlabs.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=neal_liu@aspeedtech.com \
    --cc=nikita.yoush@cogentembedded.com \
    --cc=quic_wcheng@quicinc.com \
    --cc=stern@rowland.harvard.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).