[PATCH] USB: fix buffer size limiting in skeleton driver

Fix buffer size limiting.

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

---
commit cb5b3f6950b4fbad9d8d41756f49aba792804b5b
tree 52359251d2f32767be54ab9e0e5fe2ad69f9a9f1
parent f5691d70d4aeec0ac9cff11f0cabb7d5a1735705
author Olav Kongas <[EMAIL PROTECTED]> Thu, 22 Dec 2005 12:44:52 +0200
committer Greg Kroah-Hartman <[EMAIL PROTECTED]> Wed, 04 Jan 2006 13:51:45 -0800

 drivers/usb/usb-skeleton.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/usb/usb-skeleton.c b/drivers/usb/usb-skeleton.c
index 719d23a..b6652ef 100644
--- a/drivers/usb/usb-skeleton.c
+++ b/drivers/usb/usb-skeleton.c
@@ -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_idv37&alloc_id865&op=click
_______________________________________________
linux-usb-devel@lists.sourceforge.net
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel

Reply via email to