From patchwork Mon Apr 2 16:59:53 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christophe JAILLET X-Patchwork-Id: 10320073 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id A09F460116 for ; Mon, 2 Apr 2018 17:00:14 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8EAAD28973 for ; Mon, 2 Apr 2018 17:00:14 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 82942289C6; Mon, 2 Apr 2018 17:00:14 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,FREEMAIL_FROM, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 39DF528973 for ; Mon, 2 Apr 2018 17:00:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753121AbeDBRAA (ORCPT ); Mon, 2 Apr 2018 13:00:00 -0400 Received: from smtp08.smtpout.orange.fr ([80.12.242.130]:31809 "EHLO smtp.smtpout.orange.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753130AbeDBQ74 (ORCPT ); Mon, 2 Apr 2018 12:59:56 -0400 Received: from ubuntu-CJ.home ([86.244.119.222]) by mwinf5d43 with ME id VUzu1x00V4nzehS03UzvW7; Mon, 02 Apr 2018 18:59:55 +0200 X-ME-Helo: ubuntu-CJ.home X-ME-Auth: Y2hyaXN0b3BoZS5qYWlsbGV0QHdhbmFkb28uZnI= X-ME-Date: Mon, 02 Apr 2018 18:59:55 +0200 X-ME-IP: 86.244.119.222 From: Christophe JAILLET To: jic23@kernel.org, knaack.h@gmx.de, lars@metafoo.de, pmeerw@pmeerw.net, nfarnesi4@gmail.com Cc: linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org, Christophe JAILLET Subject: [PATCH 2/2] iio: sca3000: Handle errors returned by 'sca3000_configure_ring()' in 'sca3000_probe()' Date: Mon, 2 Apr 2018 18:59:53 +0200 Message-Id: <20180402165953.9110-1-christophe.jaillet@wanadoo.fr> X-Mailer: git-send-email 2.14.1 Sender: linux-iio-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-iio@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 'sca3000_configure_ring()' can fail, so test its return value and propagate it if needed. Signed-off-by: Christophe JAILLET --- Un-tested and not 100% sure that we should bail-out if it fails. --- drivers/iio/accel/sca3000.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/iio/accel/sca3000.c b/drivers/iio/accel/sca3000.c index dae4c594c170..45285edd216f 100644 --- a/drivers/iio/accel/sca3000.c +++ b/drivers/iio/accel/sca3000.c @@ -1486,7 +1486,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,