From: Abdelnasser Hussein <abdelnasserhussein11@gmail.com>
To: jic23@kernel.org, linux-iio@vger.kernel.org
Cc: dlechner@baylibre.com, nuno.sa@analog.com, andy@kernel.org,
nicolas.ferre@microchip.com, alexandre.belloni@bootlin.com,
claudiu.beznea@tuxon.dev, giorgitchankvetadze1997@gmail.com,
amin.gattout@gmail.com, antoniu.miclaus@analog.com,
gregkh@linuxfoundation.org, mripard@kernel.org,
linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org,
Abdelnasser Hussein <abdelnasserhussein11@gmail.com>
Subject: [PATCH v4 0/3] iio: adc: at91_adc: fix trigger NULL deref and convert to devm_*
Date: Tue, 17 Nov 2026 16:05:07 +0200 [thread overview]
Message-ID: <20261117140510.391907-1-abdelnasserhussein11@gmail.com> (raw)
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
next reply other threads:[~2026-11-17 14:05 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-17 14:05 Abdelnasser Hussein [this message]
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 14:05 ` [PATCH v4 2/3] iio: adc: at91_adc: use local struct device pointer in probe Abdelnasser Hussein
2026-11-17 14:05 ` [PATCH v4 3/3] iio: adc: at91_adc: convert to device-managed resources Abdelnasser Hussein
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20261117140510.391907-1-abdelnasserhussein11@gmail.com \
--to=abdelnasserhussein11@gmail.com \
--cc=alexandre.belloni@bootlin.com \
--cc=amin.gattout@gmail.com \
--cc=andy@kernel.org \
--cc=antoniu.miclaus@analog.com \
--cc=claudiu.beznea@tuxon.dev \
--cc=dlechner@baylibre.com \
--cc=giorgitchankvetadze1997@gmail.com \
--cc=gregkh@linuxfoundation.org \
--cc=jic23@kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-iio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mripard@kernel.org \
--cc=nicolas.ferre@microchip.com \
--cc=nuno.sa@analog.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox