Re: libusb driver question: can't write to endpoint

Thomas Sailer <[email protected]>
Newsgroups gmane.linux.usb.devel
Message-ID <1173606258.16233.17.camel@unreal>
On Sat, 2007-03-10 at 15:39 -0800, Phil Dibowitz wrote:
>         while (bytes = read((int)fh, buf, SIZE)) {
>                 printf("writing %d bytes (%d)\n",SIZE,++i);
>                 if (usb_interrupt_write(udev, OUT_EP, buf, bytes, 2) < 0) {

read can return -1, at which point you stuff -1 into
usb_interrupt_write, which likely interprets the length as an unsigned
quantity, causing EFAULT.

Tom



-------------------------------------------------------------------------
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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.