mirror of
https://github.com/torvalds/linux.git
synced 2024-11-24 21:21:41 +00:00
[PATCH] USB: fix buffer size limiting in skeleton driver
Fix buffer size limiting. Signed-off-by: Olav Kongas <ok@artecdesign.ee> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This commit is contained in:
parent
f5691d70d4
commit
cb5b3f6950
@ -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;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user