]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
iio: sca3000: Handle errors returned by 'sca3000_configure_ring()' in 'sca3000_probe()'
authorChristophe JAILLET <christophe.jaillet@wanadoo.fr>
Sun, 8 Apr 2018 19:44:15 +0000 (21:44 +0200)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Sun, 15 Apr 2018 19:18:25 +0000 (20:18 +0100)
'sca3000_configure_ring()' can fail, so test its return value and
propagate it if needed.

Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
drivers/iio/accel/sca3000.c

index 562f125235dbc5351b7323305db6652c14bf6a12..4dceb75e35862136de6a0f444f92913d1a4bbdaf 100644 (file)
@@ -1481,7 +1481,9 @@ static int sca3000_probe(struct spi_device *spi)
        }
        indio_dev->modes = INDIO_DIRECT_MODE;
 
-       sca3000_configure_ring(indio_dev);
+       ret = sca3000_configure_ring(indio_dev);
+       if (ret)
+               return ret;
 
        if (spi->irq) {
                ret = request_threaded_irq(spi->irq,