public inbox for linux-media@vger.kernel.org
 help / color / mirror / Atom feed
From: Johan Hovold <johan@kernel.org>
To: Dongliang Mu <dzm91@hust.edu.cn>
Cc: Mauro Carvalho Chehab <mchehab@kernel.org>,
	gushengxian <gushengxian@yulong.com>,
	Hans Verkuil <hverkuil-cisco@xs4all.nl>,
	Oliver Neukum <oneukum@suse.com>, Sean Young <sean@mess.org>,
	Dongliang Mu <mudongliangabcd@gmail.com>,
	Mauro Carvalho Chehab <mchehab+huawei@kernel.org>,
	linux-media@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] media: flexcop-usb: fix sanity check of bNumEndpoints
Date: Thu, 2 Jun 2022 08:45:28 +0200	[thread overview]
Message-ID: <YphciEToNtxIUrzU@hovoldconsulting.com> (raw)
In-Reply-To: <20220602055027.849014-1-dzm91@hust.edu.cn>

On Thu, Jun 02, 2022 at 01:50:24PM +0800, Dongliang Mu wrote:
> From: Dongliang Mu <mudongliangabcd@gmail.com>
> 
> Commit d725d20e81c2 ("media: flexcop-usb: sanity checking of endpoint type
> ") adds a sanity check for endpoint[1], but fails to modify the sanity
> check of bNumEndpoints.
> 
> Fix this by modifying the sanity check of bNumEndpoints to 2.

Are you sure that d725d20e81c2 ("media: flexcop-usb: sanity checking of
endpoint type) was correct?

> Fixes: d725d20e81c2 ("media: flexcop-usb: sanity checking of endpoint type")
> Signed-off-by: Dongliang Mu <mudongliangabcd@gmail.com>
> ---
>  drivers/media/usb/b2c2/flexcop-usb.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/media/usb/b2c2/flexcop-usb.c b/drivers/media/usb/b2c2/flexcop-usb.c
> index 7835bb0f32fc..eb54bfdda01f 100644
> --- a/drivers/media/usb/b2c2/flexcop-usb.c
> +++ b/drivers/media/usb/b2c2/flexcop-usb.c
> @@ -509,7 +509,7 @@ static int flexcop_usb_init(struct flexcop_usb *fc_usb)
>  		return ret;
>  	}
>  
> -	if (fc_usb->uintf->cur_altsetting->desc.bNumEndpoints < 1)
> +	if (fc_usb->uintf->cur_altsetting->desc.bNumEndpoints < 2)
>  		return -ENODEV;
>  	if (!usb_endpoint_is_isoc_in(&fc_usb->uintf->cur_altsetting->endpoint[1].desc))
>  		return -ENODEV;

It looks like it should have verified the type of endpoint[0] here
instead.

Oliver?

Johan

  reply	other threads:[~2022-06-02  6:45 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-02  5:50 [PATCH] media: flexcop-usb: fix sanity check of bNumEndpoints Dongliang Mu
2022-06-02  6:45 ` Johan Hovold [this message]
2022-06-09  1:42   ` Dongliang Mu
2022-06-09 14:00     ` Johan Hovold
2022-06-10  1:27       ` Dongliang Mu
2022-06-10  7:29         ` Johan Hovold

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=YphciEToNtxIUrzU@hovoldconsulting.com \
    --to=johan@kernel.org \
    --cc=dzm91@hust.edu.cn \
    --cc=gushengxian@yulong.com \
    --cc=hverkuil-cisco@xs4all.nl \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=mchehab+huawei@kernel.org \
    --cc=mchehab@kernel.org \
    --cc=mudongliangabcd@gmail.com \
    --cc=oneukum@suse.com \
    --cc=sean@mess.org \
    /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