Re: [PATCH v2] usb: gadget: return the right length in ffs_epfile_io()

2014-03-05 Thread Felipe Balbi
...@linuxfoundation.org; linux-usb@vger.kernel.org; linux-ker...@vger.kernel.org; david.a.co...@linux.intel.com Subject: Re: [PATCH v2] usb: gadget: return the right length in ffs_epfile_io() On Tue, Mar 04, 2014 at 08:53:40PM +0100, Michal Nazarewicz wrote: On 03/04/2014 10:34 AM

Re: [PATCH v2] usb: gadget: return the right length in ffs_epfile_io()

2014-03-04 Thread Sergei Shtylyov
Hello. On 03/04/2014 10:34 AM, Chuansheng Liu wrote: When the request length is aligned to maxpacketsize, sometimes the return length ret the user space requested len. At that time, we will use min_t(size_t, ret, len) to limit the size in case of user data buffer overflow. But we need

Re: [PATCH v2] usb: gadget: return the right length in ffs_epfile_io()

2014-03-04 Thread Felipe Balbi
On Tue, Mar 04, 2014 at 08:01:15PM +0300, Sergei Shtylyov wrote: Hello. On 03/04/2014 10:34 AM, Chuansheng Liu wrote: When the request length is aligned to maxpacketsize, sometimes the return length ret the user space requested len. At that time, we will use min_t(size_t, ret, len) to

Re: [PATCH v2] usb: gadget: return the right length in ffs_epfile_io()

2014-03-04 Thread Michal Nazarewicz
On 03/04/2014 10:34 AM, Chuansheng Liu wrote: @@ -845,12 +845,14 @@ static ssize_t ffs_epfile_io(struct file *file, struct ffs_io_data *io_data) * we may end up with more data then user space has * space for. */ -

Re: [PATCH v2] usb: gadget: return the right length in ffs_epfile_io()

2014-03-04 Thread Felipe Balbi
On Tue, Mar 04, 2014 at 08:53:40PM +0100, Michal Nazarewicz wrote: On 03/04/2014 10:34 AM, Chuansheng Liu wrote: @@ -845,12 +845,14 @@ static ssize_t ffs_epfile_io(struct file *file, struct ffs_io_data *io_data) * we may end up with more data then user space

RE: [PATCH v2] usb: gadget: return the right length in ffs_epfile_io()

2014-03-04 Thread Liu, Chuansheng
...@vger.kernel.org; david.a.co...@linux.intel.com Subject: Re: [PATCH v2] usb: gadget: return the right length in ffs_epfile_io() On Tue, Mar 04, 2014 at 08:53:40PM +0100, Michal Nazarewicz wrote: On 03/04/2014 10:34 AM, Chuansheng Liu wrote: @@ -845,12 +845,14 @@ static ssize_t ffs_epfile_io(struct file

[PATCH v2] usb: gadget: return the right length in ffs_epfile_io()

2014-03-03 Thread Chuansheng Liu
When the request length is aligned to maxpacketsize, sometimes the return length ret the user space requested len. At that time, we will use min_t(size_t, ret, len) to limit the size in case of user data buffer overflow. But we need return the min_t(size_t, ret, len) to tell the user space