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

2014-03-05 Thread Felipe Balbi
bi; Sergei Shtylyov; Liu, Chuansheng; > > gre...@linuxfoundation.org; linux-...@vger.kernel.org; > > linux-kernel@vger.kernel.org; david.a.co...@linux.intel.com > > Subject: Re: [PATCH v2] usb: gadget: return the right length in > > ffs_epfile_io() > > >

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

2014-03-05 Thread Felipe Balbi
...@linuxfoundation.org; linux-...@vger.kernel.org; linux-kernel@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 Liu, Chuansheng
rg; > linux-kernel@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:

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

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: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,

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 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