From: Greg KH <greg@kroah.com>
To: Elina Pasheva <epasheva@sierrawireless.com>
Cc: dbrownell@users.sourceforge.net, davem@davemloft.net,
rfiler@sierrawireless.com, linux-usb@vger.kernel.org,
netdev@vger.kernel.org
Subject: Re: Subject: re-submit4 [ANNOUNCEMENT] NET: usb: sierra_net.c driver
Date: Thu, 22 Apr 2010 12:44:35 -0700 [thread overview]
Message-ID: <20100422194435.GA14544@kroah.com> (raw)
In-Reply-To: <1271963973.10035.6.camel@Linuxdev4-laptop>
On Thu, Apr 22, 2010 at 12:19:33PM -0700, Elina Pasheva wrote:
> +static void sierra_net_send_cmd(struct usbnet *dev,
> + u8 *cmd, int cmdlen, const char * cmd_name)
> +{
> + struct sierra_net_data *priv = sierra_net_get_private(dev);
> + int status;
> +
> + status = usb_control_msg(dev->udev, usb_sndctrlpipe(dev->udev, 0),
> + USB_CDC_SEND_ENCAPSULATED_COMMAND,
> + USB_DIR_OUT|USB_TYPE_CLASS|USB_RECIP_INTERFACE, 0,
> + priv->ifnum, cmd, cmdlen, 0);
No timeout?
> + ifnum = priv->ifnum;
> + len = usb_control_msg(dev->udev, usb_rcvctrlpipe(dev->udev, 0),
> + USB_CDC_GET_ENCAPSULATED_RESPONSE,
> + USB_DIR_IN|USB_TYPE_CLASS|USB_RECIP_INTERFACE,
> + 0, ifnum, buf, SIERRA_NET_USBCTL_BUF_LEN, 0);
No timeout?
> + if (unlikely(len < 0)) {
> + netdev_err(dev->net,
> + "usb_control_msg failed, status %d\n", len);
You don't need "unlikely", this is an extreemly slow path here.
Also, what happens for a "short read"? You don't handle that properly.
thanks,
greg k-h
next prev parent reply other threads:[~2010-04-22 19:46 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-04-22 19:19 Subject: re-submit4 [ANNOUNCEMENT] NET: usb: sierra_net.c driver Elina Pasheva
2010-04-22 19:44 ` Greg KH [this message]
2010-04-22 21:15 ` Dan Williams
2010-04-22 22:27 ` Greg KH
[not found] ` <20100422222723.GB3187-U8xfFu+wG4EAvxtiuMwx3w@public.gmane.org>
2010-04-22 23:16 ` Elina Pasheva
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=20100422194435.GA14544@kroah.com \
--to=greg@kroah.com \
--cc=davem@davemloft.net \
--cc=dbrownell@users.sourceforge.net \
--cc=epasheva@sierrawireless.com \
--cc=linux-usb@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=rfiler@sierrawireless.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.