iio: dln2: Check return value of devm_iio_trigger_register()
authorLars-Peter Clausen <lars@metafoo.de>
Mon, 1 Nov 2021 13:30:43 +0000 (14:30 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 14 Dec 2021 13:49:05 +0000 (14:49 +0100)
commit5f3d932f91cba620d1e12e82b93a9938ea9997df
tree5da0b5006320a58369b81ac88d606c7b7bb54195
parent7447f04508259eabeecb689274260ee9aeaaa9ad
iio: dln2: Check return value of devm_iio_trigger_register()

commit 90751fb9f224e0e1555b49a8aa9e68f6537e4cec upstream.

Registering a trigger can fail and the return value of
devm_iio_trigger_register() must be checked. Otherwise undefined behavior
can occur when the trigger is used.

Fixes: 7c0299e879dd ("iio: adc: Add support for DLN2 ADC")
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Link: https://lore.kernel.org/r/20211101133043.6974-1-lars@metafoo.de
Cc: <stable@vger.kernel.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/iio/adc/dln2-adc.c