iio: sca3000: Fix an error handling path in 'sca3000_probe()'
authorChristophe JAILLET <christophe.jaillet@wanadoo.fr>
Sun, 8 Apr 2018 19:44:01 +0000 (21:44 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 3 Jul 2018 09:24:57 +0000 (11:24 +0200)
commit5d6ad5a030675c6527956cf8737657b6be81b41b
treef8a8cabc45d57aacda363cc042a7f8d2e81bb0ef
parentd55209eeb1215c66d5e2b8360760c6c2ff53ae93
iio: sca3000: Fix an error handling path in 'sca3000_probe()'

commit 4a5b45383ca371e123ba103d34d4b3b87616245c upstream.

Use 'devm_iio_kfifo_allocate()' instead of 'iio_kfifo_allocate()' in order
to simplify code and avoid a memory leak in an error path in
'sca3000_probe()'. A call to 'sca3000_unconfigure_ring()' was missing.

Sent via the next merge window as unimportant bug and there are
other patches dependent on it.

Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
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/accel/sca3000.c