Greg, please apply.

Olav


Fix buffer size limiting.

Signed-off-by: Olav Kongas <[EMAIL PROTECTED]>

diff -purN a/drivers/usb/usb-skeleton.c b/drivers/usb/usb-skeleton.c
--- a/drivers/usb/usb-skeleton.c        2005-12-22 12:26:43.000000000 +0200
+++ b/drivers/usb/usb-skeleton.c        2005-12-22 12:33:28.000000000 +0200
@@ -166,7 +166,7 @@ static ssize_t skel_write(struct file *f
        int retval = 0;
        struct urb *urb = NULL;
        char *buf = NULL;
-       size_t writesize = max(count, MAX_TRANSFER);
+       size_t writesize = min(count, MAX_TRANSFER);
 
        dev = (struct usb_skel *)file->private_data;
 


-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click
_______________________________________________
[email protected]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel

Reply via email to