mbox series

[v2,0/2] iio: buffer: allocation and freeing buffers fix and optimization

Message ID 20211013094923.2473-1-andriy.shevchenko@linux.intel.com (mailing list archive)
Headers show
Series iio: buffer: allocation and freeing buffers fix and optimization | expand

Message

Andy Shevchenko Oct. 13, 2021, 9:49 a.m. UTC
Yang submitted a fix, but I think the code can be refactored a bit to be more
robust against similar mistakes in the future, if any.

In v2:
- put SoB Yang's patch (it's good for backporting)
- added refactoring patch on top of Yang's fix

Andy Shevchenko (1):
  iio: buffer: Use dedicated variable in
    iio_buffers_alloc_sysfs_and_mask()

Yang Yingliang (1):
  iio: buffer: Fix double-free in iio_buffers_alloc_sysfs_and_mask()

 drivers/iio/industrialio-buffer.c | 18 +++++++-----------
 1 file changed, 7 insertions(+), 11 deletions(-)

Comments

Jonathan Cameron Oct. 17, 2021, 2:26 p.m. UTC | #1
On Wed, 13 Oct 2021 12:49:21 +0300
Andy Shevchenko <andriy.shevchenko@linux.intel.com> wrote:

> Yang submitted a fix, but I think the code can be refactored a bit to be more
> robust against similar mistakes in the future, if any.
> 
> In v2:
> - put SoB Yang's patch (it's good for backporting)
> - added refactoring patch on top of Yang's fix
> 
> Andy Shevchenko (1):
>   iio: buffer: Use dedicated variable in
>     iio_buffers_alloc_sysfs_and_mask()
> 
> Yang Yingliang (1):
>   iio: buffer: Fix double-free in iio_buffers_alloc_sysfs_and_mask()
> 
>  drivers/iio/industrialio-buffer.c | 18 +++++++-----------
>  1 file changed, 7 insertions(+), 11 deletions(-)
> 
1st patch applied to the fixes-togreg branch of iio.git. I may well end up
sending these in the merge window anyway in which case I'll probably stick patch 2
on top of it before sending.  If not I'll pick that up next cycle now.

Thanks,

Jonathan
Andy Shevchenko Nov. 15, 2021, 11:12 a.m. UTC | #2
On Sun, Oct 17, 2021 at 03:26:11PM +0100, Jonathan Cameron wrote:
> On Wed, 13 Oct 2021 12:49:21 +0300
> Andy Shevchenko <andriy.shevchenko@linux.intel.com> wrote:
> 
> > Yang submitted a fix, but I think the code can be refactored a bit to be more
> > robust against similar mistakes in the future, if any.
> > 
> > In v2:
> > - put SoB Yang's patch (it's good for backporting)
> > - added refactoring patch on top of Yang's fix
> > 
> > Andy Shevchenko (1):
> >   iio: buffer: Use dedicated variable in
> >     iio_buffers_alloc_sysfs_and_mask()
> > 
> > Yang Yingliang (1):
> >   iio: buffer: Fix double-free in iio_buffers_alloc_sysfs_and_mask()
> > 
> >  drivers/iio/industrialio-buffer.c | 18 +++++++-----------
> >  1 file changed, 7 insertions(+), 11 deletions(-)
> > 
> 1st patch applied to the fixes-togreg branch of iio.git. I may well end up
> sending these in the merge window anyway in which case I'll probably stick patch 2
> on top of it before sending.  If not I'll pick that up next cycle now.

Is it a right time now?
Jonathan Cameron Nov. 20, 2021, 2:17 p.m. UTC | #3
On Mon, 15 Nov 2021 13:12:24 +0200
Andy Shevchenko <andriy.shevchenko@linux.intel.com> wrote:

> On Sun, Oct 17, 2021 at 03:26:11PM +0100, Jonathan Cameron wrote:
> > On Wed, 13 Oct 2021 12:49:21 +0300
> > Andy Shevchenko <andriy.shevchenko@linux.intel.com> wrote:
> >   
> > > Yang submitted a fix, but I think the code can be refactored a bit to be more
> > > robust against similar mistakes in the future, if any.
> > > 
> > > In v2:
> > > - put SoB Yang's patch (it's good for backporting)
> > > - added refactoring patch on top of Yang's fix
> > > 
> > > Andy Shevchenko (1):
> > >   iio: buffer: Use dedicated variable in
> > >     iio_buffers_alloc_sysfs_and_mask()
> > > 
> > > Yang Yingliang (1):
> > >   iio: buffer: Fix double-free in iio_buffers_alloc_sysfs_and_mask()
> > > 
> > >  drivers/iio/industrialio-buffer.c | 18 +++++++-----------
> > >  1 file changed, 7 insertions(+), 11 deletions(-)
> > >   
> > 1st patch applied to the fixes-togreg branch of iio.git. I may well end up
> > sending these in the merge window anyway in which case I'll probably stick patch 2
> > on top of it before sending.  If not I'll pick that up next cycle now.  
> 
> Is it a right time now?
> 
Applied, but needed a bit of hand tweaking as patches have crossed with this.

Pushed out as testing for 0-day to see if we missed anything.

Thanks,

Jonathan