On Sun, 21 Jan 2007, Sarah Bailey wrote:
> Currently uses wait_for_completion() instead of
> wait_for_completion_interruptible().
You might as well fix that now. It shouldn't be much of a change.
> +ssize_t ep_read(struct file * filp, char __user *buff,
> + size_t count, loff_t * offp)
> +{
> + struct ep_device *ep_dev;
> + char *k_buff;
> + struct urb *urb;
> + unsigned int pipe;
> + int retval = -ENOMEM;
> + DECLARE_COMPLETION_ONSTACK(completion);
> +
> + ep_dev = filp->private_data;
> + dev_dbg(&ep_dev->dev, "%s called for %s\n", __FUNCTION__,
> + ep_dev->dev.bus_id);
> +
> + if(!usb_endpoint_xfer_bulk(ep_dev->desc))
Minor style issue: "if" is not a function call, so there should be a
blank space before the open paren. This holds throughout your patch.
> + return 0;
> +
> + k_buff = kmalloc(count, GFP_KERNEL);
You may want to put some size limit here on count. Do other char device
drivers worry about this sort of thing? With a bulk endpoint, the user
could try to pass a very large amount of data. You could, for instance,
divide the data up into pieces each of which is a not-too-large multiple
of the maxpacket size, say no more than a few pages.
Note that the old usbfs driver has a size limit.
Alan Stern
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
[email protected]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel