All the mail mirrored from lore.kernel.org
 help / color / mirror / Atom feed
From: syzbot <syzbot+5f29dc6a889fc42bd896@syzkaller.appspotmail.com>
To: n.zhandarovich@fintech.ru
Cc: linux-kernel@vger.kernel.org, n.zhandarovich@fintech.ru,
	 syzkaller-bugs@googlegroups.com
Subject: Re: [syzbot] WARNING in vmk80xx_auto_attach/usb_submit_urb
Date: Fri, 05 Apr 2024 06:30:35 -0700	[thread overview]
Message-ID: <000000000000f3b0e906155975f2@google.com> (raw)
In-Reply-To: <20240405133030.21567-1-n.zhandarovich@fintech.ru>

> Refactor endpoint checks to ensure there is no ambivalence
> about endpoint types.
>
> Try a specific branch to mitigate unrelated issues with boot/build.
>
> #syz test git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net-next.git 4090fa373f0e763c43610853>

"4090fa373f0e763c43610853>" does not look like a valid git branch or commit.

> ---
>  drivers/comedi/drivers/vmk80xx.c | 35 ++++++++++++-----------------------
>  1 file changed, 12 insertions(+), 23 deletions(-)
>
> diff --git a/drivers/comedi/drivers/vmk80xx.c b/drivers/comedi/drivers/vmk80xx.c
> index 4536ed43f65b..476885403c61 100644
> --- a/drivers/comedi/drivers/vmk80xx.c
> +++ b/drivers/comedi/drivers/vmk80xx.c
> @@ -641,33 +641,22 @@ static int vmk80xx_find_usb_endpoints(struct comedi_device *dev)
>  	struct vmk80xx_private *devpriv = dev->private;
>  	struct usb_interface *intf = comedi_to_usb_interface(dev);
>  	struct usb_host_interface *iface_desc = intf->cur_altsetting;
> -	struct usb_endpoint_descriptor *ep_desc;
> -	int i;
> +	struct usb_endpoint_descriptor *ep_rx_desc, *ep_tx_desc;
> +	int i, ret;
>  
> -	if (iface_desc->desc.bNumEndpoints != 2)
> -		return -ENODEV;
> -
> -	for (i = 0; i < iface_desc->desc.bNumEndpoints; i++) {
> -		ep_desc = &iface_desc->endpoint[i].desc;
> -
> -		if (usb_endpoint_is_int_in(ep_desc) ||
> -		    usb_endpoint_is_bulk_in(ep_desc)) {
> -			if (!devpriv->ep_rx)
> -				devpriv->ep_rx = ep_desc;
> -			continue;
> -		}
> -
> -		if (usb_endpoint_is_int_out(ep_desc) ||
> -		    usb_endpoint_is_bulk_out(ep_desc)) {
> -			if (!devpriv->ep_tx)
> -				devpriv->ep_tx = ep_desc;
> -			continue;
> -		}
> -	}
> +	if (devpriv->model == VMK8061_MODEL)
> +		ret = usb_find_common_endpoints(iface_desc, &ep_rx_desc,
> +						&ep_tx_desc, NULL, NULL);
> +	else
> +		ret = usb_find_common_endpoints(iface_desc, NULL, NULL,
> +						&ep_rx_desc, &ep_tx_desc);
>  
> -	if (!devpriv->ep_rx || !devpriv->ep_tx)
> +	if (ret)
>  		return -ENODEV;
>  
> +	devpriv->ep_rx = ep_rx_desc;
> +	devpriv->ep_tx = ep_tx_desc;
> +
>  	if (!usb_endpoint_maxp(devpriv->ep_rx) || !usb_endpoint_maxp(devpriv->ep_tx))
>  		return -EINVAL;
>  

  reply	other threads:[~2024-04-05 13:30 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-05 13:30 [syzbot] WARNING in vmk80xx_auto_attach/usb_submit_urb Nikita Zhandarovich
2024-04-05 13:30 ` syzbot [this message]
  -- strict thread matches above, loose matches on Subject: below --
2024-04-07 13:02 Nikita Zhandarovich
2024-04-05 13:34 Nikita Zhandarovich
2021-06-11 20:02 syzbot
2021-06-12  6:59 ` Greg KH
2021-06-12 14:19   ` Alan Stern

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=000000000000f3b0e906155975f2@google.com \
    --to=syzbot+5f29dc6a889fc42bd896@syzkaller.appspotmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=n.zhandarovich@fintech.ru \
    --cc=syzkaller-bugs@googlegroups.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.