From: Olav Kongas Date: Thu, 22 Dec 2005 10:44:52 +0000 (+0200) Subject: [PATCH] USB: fix buffer size limiting in skeleton driver X-Git-Tag: v2.6.16-rc1~474^2~22^2~10^2~1 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=cb5b3f6950b4fbad9d8d41756f49aba792804b5b;p=linux-2.6 [PATCH] USB: fix buffer size limiting in skeleton driver Fix buffer size limiting. Signed-off-by: Olav Kongas Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/usb/usb-skeleton.c b/drivers/usb/usb-skeleton.c index 719d23a4ac..b6652ef568 100644 --- a/drivers/usb/usb-skeleton.c +++ b/drivers/usb/usb-skeleton.c @@ -166,7 +166,7 @@ static ssize_t skel_write(struct file *file, const char *user_buffer, size_t cou 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;