mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH v4 0/3] iio: adc: at91_adc: fix trigger NULL deref and convert to devm_*
@ 2026-11-17 14:05 Abdelnasser Hussein
  2026-11-17 14:05 ` [PATCH v4 1/3] iio: adc: at91_adc: fix NULL pointer dereference on trigger remove Abdelnasser Hussein
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Abdelnasser Hussein @ 2026-11-17 14:05 UTC (permalink / raw)
  To: jic23, linux-iio
  Cc: dlechner, nuno.sa, andy, nicolas.ferre, alexandre.belloni,
	claudiu.beznea, giorgitchankvetadze1997, amin.gattout,
	antoniu.miclaus, gregkh, mripard, linux-arm-kernel, linux-kernel,
	Abdelnasser Hussein

This series fixes a NULL pointer dereference in at91_adc when external
triggers are absent from the Device Tree, and converts 
the driver to devm_* APIs.

The series is split
into three patches:
  1.NULL-pointer fix.
  2.introduce a local 'struct device *dev' and use sizeof(*st) in probe().
  3.removing manual cleanup and inlining trigger
     and buffer setup helpers into probe().

Changes in v4:
  - Split v3 into three patches (Joshua Crofts, Jonathan Cameron).
  - Patch 1:NULL check.
  - Patch 2: Separate the local 'dev' pointer introduction and sizeof(*st)
    change (Jonathan Cameron).
  - Patch 3:
    - Remove at91_adc_allocate_trigger() and at91_adc_buffer_init(),
      inline their logic in probe(), and avoid relying on idev->dev.parent
      (Jonathan Cameron).
    - Remove redundant dev_err() on trigger allocation -ENOMEM
      (Jonathan Cameron).
    - Use dev_err_probe() in at91_ts_register() and for
      devm_iio_device_register() failures in probe() (Jonathan Cameron).
    
Changes in v3:
  - Remove redundant dev_err() after devm_input_allocate_device()
    (Andy Shevchenko).
  - Introduce local 'struct device *dev = &pdev->dev' in probe()
    (Andy Shevchenko).
  - Declare the loop iterator inside the for-loop.

Changes in v2:
  - Replace the simple NULL check with a full devm_* conversion,
    as suggested by Jonathan Cameron.

Abdelnasser Hussein (3):
  iio: adc: at91_adc: fix NULL pointer dereference on trigger remove
  iio: adc: at91_adc: use local struct device pointer in probe
  iio: adc: at91_adc: convert to device-managed resources

 drivers/iio/adc/at91_adc.c | 229 ++++++++++---------------------------
 1 file changed, 62 insertions(+), 167 deletions(-)

-- 
2.56.0


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2026-11-17 16:57 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-11-17 14:05 [PATCH v4 0/3] iio: adc: at91_adc: fix trigger NULL deref and convert to devm_* Abdelnasser Hussein
2026-11-17 14:05 ` [PATCH v4 1/3] iio: adc: at91_adc: fix NULL pointer dereference on trigger remove Abdelnasser Hussein
2026-11-17 16:44   ` Andy Shevchenko
2026-11-17 16:45     ` Andy Shevchenko
2026-11-17 14:05 ` [PATCH v4 2/3] iio: adc: at91_adc: use local struct device pointer in probe Abdelnasser Hussein
2026-11-17 16:50   ` Andy Shevchenko
2026-11-17 14:05 ` [PATCH v4 3/3] iio: adc: at91_adc: convert to device-managed resources Abdelnasser Hussein
2026-11-17 16:57   ` Andy Shevchenko

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®