]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
iio: of_iio_channel_get_by_name() returns non-null pointers for error legs
authorAdam Thomson <Adam.Thomson.Opensource@diasemi.com>
Thu, 6 Nov 2014 12:11:00 +0000 (12:11 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 9 Jul 2014 18:21:30 +0000 (11:21 -0700)
commitbadceea9879bdd4e1eadab1498e91bf2c394658a
treeb28dcbee2c8038cb2a21ae9369486ad9cd5dfe99
parent2c323893a2dadae1aae154b1e4a6f70563831c2d
iio: of_iio_channel_get_by_name() returns non-null pointers for error legs

commit a2c12493ed7e63a18cef33a71686d12ffcd6600e upstream.

Currently in the inkern.c code for IIO framework, the function
of_iio_channel_get_by_name() will return a non-NULL pointer when
it cannot find a channel using of_iio_channel_get() and when it
tries to search for 'io-channel-ranges' property and fails. This
is incorrect behaviour as the function which calls this expects
a NULL pointer for failure. This patch rectifies the issue.

Signed-off-by: Adam Thomson <Adam.Thomson.Opensource@diasemi.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/iio/inkern.c