[PATCH v3 0/4] iio: initialise ddata for iio_get_acpi_device_name_and_data()

Andy Shevchenko posted 4 patches 3 weeks, 2 days ago
drivers/iio/accel/kxcjk-1013.c | 30 ++++++------------------------
drivers/iio/light/isl29018.c   |  2 +-
drivers/iio/light/ltr501.c     |  2 +-
3 files changed, 8 insertions(+), 26 deletions(-)
[PATCH v3 0/4] iio: initialise ddata for iio_get_acpi_device_name_and_data()
Posted by Andy Shevchenko 3 weeks, 2 days ago
Dan reported that ddata might be used uninitialised in some cases.
Let's initialise it to NULL (patches 1 - 3). With that, update one driver
to drop an unneeded anymore check (included in patch 3).

While at it, one more cleanup to kxcjk-1013 (patch 4) is added.

Jonathan, dunno if you want to rebase at this stage (probably not),
but if you do, feel free to fold the patches 1-3 to the initial code.

In v3:
- made Subject more specific for patches 1-3 (Markus)

In v2:
- rewritten patches 1-3 to do the job on the caller side (Jonathan)

Andy Shevchenko (4):
  iio: light: isl29018: Assign NULL to ddata in isl29018_probe()
  iio: light: ltr501: Assign NULL to ddata in ltr501_probe()
  iio: accel: kxcjk-1013: Assign NULL to ddata in kxcjk1013_probe()
  iio: accel: kxcjk-1013: Deduplicate ODR startup time array

 drivers/iio/accel/kxcjk-1013.c | 30 ++++++------------------------
 drivers/iio/light/isl29018.c   |  2 +-
 drivers/iio/light/ltr501.c     |  2 +-
 3 files changed, 8 insertions(+), 26 deletions(-)

-- 
2.43.0.rc1.1336.g36b5255a03ac
Re: [PATCH v3 0/4] iio: initialise ddata for iio_get_acpi_device_name_and_data()
Posted by Jonathan Cameron 3 weeks, 2 days ago
On Fri,  1 Nov 2024 15:16:00 +0200
Andy Shevchenko <andriy.shevchenko@linux.intel.com> wrote:

> Dan reported that ddata might be used uninitialised in some cases.
> Let's initialise it to NULL (patches 1 - 3). With that, update one driver
> to drop an unneeded anymore check (included in patch 3).
> 
> While at it, one more cleanup to kxcjk-1013 (patch 4) is added.
> 
> Jonathan, dunno if you want to rebase at this stage (probably not),
> but if you do, feel free to fold the patches 1-3 to the initial code.
Ah. I've just picked v2, but given I squashed anyway the commit message
changes don't matter.  I was curious what Assing meant but not need to
ask given I wasn't going to keep it.


Jonathan

> 
> In v3:
> - made Subject more specific for patches 1-3 (Markus)
> 
> In v2:
> - rewritten patches 1-3 to do the job on the caller side (Jonathan)
> 
> Andy Shevchenko (4):
>   iio: light: isl29018: Assign NULL to ddata in isl29018_probe()
>   iio: light: ltr501: Assign NULL to ddata in ltr501_probe()
>   iio: accel: kxcjk-1013: Assign NULL to ddata in kxcjk1013_probe()
>   iio: accel: kxcjk-1013: Deduplicate ODR startup time array
> 
>  drivers/iio/accel/kxcjk-1013.c | 30 ++++++------------------------
>  drivers/iio/light/isl29018.c   |  2 +-
>  drivers/iio/light/ltr501.c     |  2 +-
>  3 files changed, 8 insertions(+), 26 deletions(-)
>
Re: [PATCH v3 0/4] iio: initialise ddata for iio_get_acpi_device_name_and_data()
Posted by Andy Shevchenko 3 weeks, 2 days ago
On Fri, Nov 01, 2024 at 02:59:38PM +0000, Jonathan Cameron wrote:
> On Fri,  1 Nov 2024 15:16:00 +0200
> Andy Shevchenko <andriy.shevchenko@linux.intel.com> wrote:
> 
> > Dan reported that ddata might be used uninitialised in some cases.
> > Let's initialise it to NULL (patches 1 - 3). With that, update one driver
> > to drop an unneeded anymore check (included in patch 3).
> > 
> > While at it, one more cleanup to kxcjk-1013 (patch 4) is added.
> > 
> > Jonathan, dunno if you want to rebase at this stage (probably not),
> > but if you do, feel free to fold the patches 1-3 to the initial code.
> Ah. I've just picked v2, but given I squashed anyway the commit message
> changes don't matter.

Thanks, I have looked into the resulting changes and it all LGTM!

> I was curious what Assing meant but not need to
> ask given I wasn't going to keep it.

He-he :-)


-- 
With Best Regards,
Andy Shevchenko