提交 cb5b3f69 编写于 作者: O Olav Kongas 提交者: Greg Kroah-Hartman

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

Fix buffer size limiting.
Signed-off-by: NOlav Kongas <ok@artecdesign.ee>
Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
上级 f5691d70
......@@ -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;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册