From: Zicheng Qu <quzicheng@xxxxxxxxxx> commit 3993ca4add248f0f853f54f9273a7de850639f33 upstream. In the fwnode_iio_channel_get_by_name(), iterating over parent nodes to acquire IIO channels via fwnode_for_each_parent_node(). The variable chan was mistakenly attempted on the original node instead of the current parent node. This patch corrects the logic to ensure that __fwnode_iio_channel_get_by_name() is called with the correct parent node. Cc: stable@xxxxxxxxxxxxxxx # v6.6+ Fixes: 1e64b9c5f9a0 ("iio: inkern: move to fwnode properties") Signed-off-by: Zicheng Qu <quzicheng@xxxxxxxxxx> Link: https://patch.msgid.link/20241102092525.2389952-1-quzicheng@xxxxxxxxxx Signed-off-by: Jonathan Cameron <Jonathan.Cameron@xxxxxxxxxx> Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx> --- drivers/iio/inkern.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/drivers/iio/inkern.c +++ b/drivers/iio/inkern.c @@ -276,7 +276,7 @@ struct iio_channel *fwnode_iio_channel_g return ERR_PTR(-ENODEV); } - chan = __fwnode_iio_channel_get_by_name(fwnode, name); + chan = __fwnode_iio_channel_get_by_name(parent, name); if (!IS_ERR(chan) || PTR_ERR(chan) != -ENODEV) { fwnode_handle_put(parent); return chan; Patches currently in stable-queue which might be from quzicheng@xxxxxxxxxx are queue-6.1/iio-fix-fwnode_handle-in-__fwnode_iio_channel_get_by_name.patch queue-6.1/ad7780-fix-division-by-zero-in-ad7780_write_raw.patch queue-6.1/iio-adc-ad7923-fix-buffer-overflow-for-tx_buf-and-ring_xfer.patch