From patchwork Wed Jun 5 21:29:56 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexey Khoroshilov X-Patchwork-Id: 2674951 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) by patchwork1.kernel.org (Postfix) with ESMTP id EC6343FD4F for ; Wed, 5 Jun 2013 21:32:12 +0000 (UTC) Received: from merlin.infradead.org ([205.233.59.134]) by casper.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1UkLIa-0000p3-K0; Wed, 05 Jun 2013 21:31:17 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1UkLHt-0007iG-Fb; Wed, 05 Jun 2013 21:30:33 +0000 Received: from mail.ispras.ru ([83.149.199.45]) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1UkLHq-0007hD-F7 for linux-arm-kernel@lists.infradead.org; Wed, 05 Jun 2013 21:30:31 +0000 Received: from localhost.localdomain (unknown [91.79.128.188]) by mail.ispras.ru (Postfix) with ESMTPSA id A2E3354015B; Thu, 6 Jun 2013 01:30:03 +0400 (MSK) From: Alexey Khoroshilov To: Barry Song Subject: [PATCH] spi/sirf: fix error propagation in spi_sirfsoc_probe() Date: Thu, 6 Jun 2013 01:29:56 +0400 Message-Id: <1370467796-4641-1-git-send-email-khoroshilov@ispras.ru> X-Mailer: git-send-email 1.8.1.2 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20130605_173030_638319_9BD19B66 X-CRM114-Status: UNSURE ( 9.12 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -2.4 (--) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-2.4 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.5 RP_MATCHES_RCVD Envelope sender domain matches handover relay domain -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] Cc: ldv-project@linuxtesting.org, linux-kernel@vger.kernel.org, Mark Brown , Alexey Khoroshilov , Grant Likely , spi-devel-general@lists.sourceforge.net, linux-arm-kernel@lists.infradead.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org If pinctrl_get_select_default() fails, spi_sirfsoc_probe() returns IS_ERR(sspi->p) instead of PTR_ERR(sspi->p). Found by Linux Driver Verification project (linuxtesting.org). Signed-off-by: Alexey Khoroshilov Acked-by: Barry Song --- drivers/spi/spi-sirf.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/spi/spi-sirf.c b/drivers/spi/spi-sirf.c index 0808cd5..94c3920 100644 --- a/drivers/spi/spi-sirf.c +++ b/drivers/spi/spi-sirf.c @@ -559,9 +559,10 @@ static int spi_sirfsoc_probe(struct platform_device *pdev) sspi->bitbang.master->dev.of_node = pdev->dev.of_node; sspi->p = pinctrl_get_select_default(&pdev->dev); - ret = IS_ERR(sspi->p); - if (ret) + if (IS_ERR(sspi->p)) { + ret = PTR_ERR(sspi->p); goto free_master; + } sspi->clk = clk_get(&pdev->dev, NULL); if (IS_ERR(sspi->clk)) {