diff --git a/drivers/iio/adc/max1027.c b/drivers/iio/adc/max1027.c index 372f2ca96eaed8274a2b87621c1b793c324f49cf..9eaeb1784c3b4ea9d3e2f04fb67abcf8e0c6e20c 100644 --- a/drivers/iio/adc/max1027.c +++ b/drivers/iio/adc/max1027.c @@ -446,10 +446,8 @@ static int max1027_probe(struct spi_device *spi) st->buffer = devm_kmalloc_array(&indio_dev->dev, indio_dev->num_channels, 2, GFP_KERNEL); - if (!st->buffer) { - dev_err(&indio_dev->dev, "Can't allocate buffer\n"); + if (!st->buffer) return -ENOMEM; - } if (spi->irq) { ret = devm_iio_triggered_buffer_setup(&spi->dev, indio_dev,