]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
iio:ad7266: Fix broken regulator error handling
authorMark Brown <broonie@kernel.org>
Mon, 20 Jun 2016 12:53:32 +0000 (13:53 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 27 Jul 2016 15:42:21 +0000 (08:42 -0700)
commit1ac9c884397b7caf2044fca8a64e337a87ccd060
tree0daf605ded6c0dbd10a8447a4715f3db8967d82f
parent26b3c9975e2a6e456a98643e33a87458562f66ae
iio:ad7266: Fix broken regulator error handling

commit 6b7f4e25f3309f106a5c7ff42c8231494cf285d3 upstream.

All regulator_get() variants return either a pointer to a regulator or an
ERR_PTR() so testing for NULL makes no sense and may lead to bugs if we
use NULL as a valid regulator. Fix this by using IS_ERR() as expected.

Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/iio/adc/ad7266.c