[PATCH v1 0/3] iio: core: fix error path in iio_device_alloc()

Andy Shevchenko posted 3 patches 2 months, 4 weeks ago
drivers/iio/industrialio-core.c | 18 +++++++++++-------
1 file changed, 11 insertions(+), 7 deletions(-)
[PATCH v1 0/3] iio: core: fix error path in iio_device_alloc()
Posted by Andy Shevchenko 2 months, 4 weeks ago
The series is induced by the similar fixes in viio_trigger_alloc().
Basically two things happen here: 1) add missed mutex_destroy()
calls, and 2) refactor to make sure we clean resources with put_device()
when appropriate.

Andy Shevchenko (3):
  iio: core: add missing mutex_destroy in iio_dev_release()
  iio: core: Clean up device correctly on iio_device_alloc() failure
  iio: core: Replace lockdep_set_class() + mutex_init() by combined call

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

-- 
2.50.1
Re: [PATCH v1 0/3] iio: core: fix error path in iio_device_alloc()
Posted by Nuno Sá 2 months, 4 weeks ago
On Wed, 2025-11-12 at 15:55 +0100, Andy Shevchenko wrote:
> The series is induced by the similar fixes in viio_trigger_alloc().
> Basically two things happen here: 1) add missed mutex_destroy()
> calls, and 2) refactor to make sure we clean resources with put_device()
> when appropriate.
> 
> Andy Shevchenko (3):
>   iio: core: add missing mutex_destroy in iio_dev_release()
>   iio: core: Clean up device correctly on iio_device_alloc() failure
>   iio: core: Replace lockdep_set_class() + mutex_init() by combined call
> 
>  drivers/iio/industrialio-core.c | 18 +++++++++++-------
>  1 file changed, 11 insertions(+), 7 deletions(-)

LGTM,

Reviewed-by: Nuno Sá <nuno.sa@analog.com>
Re: [PATCH v1 0/3] iio: core: fix error path in iio_device_alloc()
Posted by Jonathan Cameron 2 months, 3 weeks ago
On Wed, 12 Nov 2025 18:00:42 +0000
Nuno Sá <noname.nuno@gmail.com> wrote:

> On Wed, 2025-11-12 at 15:55 +0100, Andy Shevchenko wrote:
> > The series is induced by the similar fixes in viio_trigger_alloc().
> > Basically two things happen here: 1) add missed mutex_destroy()
> > calls, and 2) refactor to make sure we clean resources with put_device()
> > when appropriate.
> > 
> > Andy Shevchenko (3):
> >   iio: core: add missing mutex_destroy in iio_dev_release()
> >   iio: core: Clean up device correctly on iio_device_alloc() failure
> >   iio: core: Replace lockdep_set_class() + mutex_init() by combined call
> > 
> >  drivers/iio/industrialio-core.c | 18 +++++++++++-------
> >  1 file changed, 11 insertions(+), 7 deletions(-)  
> 
> LGTM,
> 
> Reviewed-by: Nuno Sá <nuno.sa@analog.com>
> 
I'm not going to rush these in given where we are in the cycle
and the fact only some are fixes (and really no one cares that
much about mutex_destroy() as it only does anything at all in
a particular debug setup.)

So applied to the togreg branch of iio.git and pushed out as testing
for now.

Thanks,

Jonathan