Received: by 10.192.165.148 with SMTP id m20csp141017imm; Thu, 3 May 2018 16:41:43 -0700 (PDT) X-Google-Smtp-Source: AB8JxZpqLvDl+8Y1Uc4SDgijP07pwHWq3jhs9YeoDbaC2nJ6BkzpF+lWnDsE77SGwlInPuW+goSA X-Received: by 10.98.103.154 with SMTP id t26mr25006831pfj.24.1525390902960; Thu, 03 May 2018 16:41:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525390902; cv=none; d=google.com; s=arc-20160816; b=pzgwr939R6k9uryeZPrg5q8YkT2WyQRo+mSlYa+SycZrNnBmo0pCO3LLOExVcAAePI s2ypvhylTrz9UDYFOkfKJCBla1QSn6rSLrB/dSpT2s13VejSwI0YMv81q8Tg/rCeJnGn G1l7dizGFjlhf1EqeIw8FYwq23YW4xEgAR+luNADAyR0GNwXlV/FNPzRTUaqAQhAjLrH ebsSchPftQDjq9TB7An2mQrKrToiNoZjJ75xY4j7HBJYQGHCB96PpEJnXfVItd7av31o aRTPJ0Bhbin+TX/hvIKFAJCuzww4u7JfFhooTEnvh2bjBLOrGEkmX7g0pflNVCEpNM1y y9OA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:date:message-id:in-reply-to:subject:cc:to :from:dkim-signature:arc-authentication-results; bh=V1HqofMrZ4cCw3g2yXGd9S2NgHgGZKn3uLpRk0FnqbE=; b=zAkPOUliameuY+Lr+IXOfluVnx1s75ZtPPFuiZZJ9g1Wetl7WOPBNr6580M3HWJDzv tgHcWzSCKJs5ZFPkPwS2ZrzqKZvY/oeEDCfAGjMCoZnaJfi6UDwDO7Nhypyub1608tc7 1TfzkbFsdsWq7KcMbP3Cd1ViOECMoYCROT/dKB6Odt/1E4CqMH/maFkbAsrwNIwzdo/Z qYyq/KIF+Nq5bIAIzpVuUSI8wA4JNt5jMU2OfBdL7IGkOVHSmmMtCfz4F0ZHUYI2PwNE RzkiusjLP9PzKmvHQAYgHi5T+9iv+yKzVGBl0y0irn7H6f5/6icUDcInw81R14Mc5AOz oxJQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@sirena.org.uk header.s=20170815-heliosphere header.b=tGCUWU8c; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w9-v6si12295536pgc.181.2018.05.03.16.41.28; Thu, 03 May 2018 16:41:42 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@sirena.org.uk header.s=20170815-heliosphere header.b=tGCUWU8c; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751308AbeECXlA (ORCPT + 99 others); Thu, 3 May 2018 19:41:00 -0400 Received: from heliosphere.sirena.org.uk ([172.104.155.198]:37972 "EHLO heliosphere.sirena.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750930AbeECXk7 (ORCPT ); Thu, 3 May 2018 19:40:59 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sirena.org.uk; s=20170815-heliosphere; h=Date:Message-Id:In-Reply-To: Subject:Cc:To:From:Sender:Reply-To:MIME-Version:Content-Type: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:References: List-Id:List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner: List-Archive; bh=V1HqofMrZ4cCw3g2yXGd9S2NgHgGZKn3uLpRk0FnqbE=; b=tGCUWU8cPRd4 ENi/YAi3vCwiXvqmTUOhFXiwhOMDPMIV9Aa/hq2xS7vlsazWVakwsTZyMJRmjUlnPx8JvIPVME44i cX8xDKiEyvYYCWdh7hU34iG1m3ByjlaM0MbS5FCaaqi6jDWOvp+u0UwDiNAuhxOV9v2H1tT2PKO1g Vo9vw=; Received: from [211.55.52.16] (helo=finisterre.ee.mobilebroadband) by heliosphere.sirena.org.uk with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1fENqH-0004cm-Rp; Thu, 03 May 2018 23:40:54 +0000 Received: by finisterre.ee.mobilebroadband (Postfix, from userid 1000) id 727DD44007A; Fri, 4 May 2018 00:40:49 +0100 (BST) From: Mark Brown To: Tobias Jordan Cc: Mark Brown , Daniel Mack , Haojian Zhuang , Robert Jarzmik , Mark Brown , linux-arm-kernel@lists.infradead.org, linux-spi@vger.kernel.org, linux-kernel@vger.kernel.org, linux-spi@vger.kernel.org Subject: Applied "spi: pxa2xx: check clk_prepare_enable() return value" to the spi tree In-Reply-To: <20180430143006.ckcbicijw2to2ghl@agrajag.zerfleddert.de> Message-Id: <20180503234049.727DD44007A@finisterre.ee.mobilebroadband> Date: Fri, 4 May 2018 00:40:49 +0100 (BST) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The patch spi: pxa2xx: check clk_prepare_enable() return value has been applied to the spi tree at https://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi.git All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted. You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed. If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced. Please add any relevant lists and maintainers to the CCs when replying to this mail. Thanks, Mark From 62bbc864d1946c715063bd481bff3641fd1324e2 Mon Sep 17 00:00:00 2001 From: Tobias Jordan Date: Mon, 30 Apr 2018 16:30:06 +0200 Subject: [PATCH] spi: pxa2xx: check clk_prepare_enable() return value clk_prepare_enable() can fail, so its return value should be checked and acted upon. Found by Linux Driver Verification project (linuxtesting.org). Fixes: 3343b7a6d2cd ("spi/pxa2xx: convert to the common clk framework") Signed-off-by: Tobias Jordan Signed-off-by: Mark Brown --- drivers/spi/spi-pxa2xx.c | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/drivers/spi/spi-pxa2xx.c b/drivers/spi/spi-pxa2xx.c index 40f1346b8188..0b2d60d30f69 100644 --- a/drivers/spi/spi-pxa2xx.c +++ b/drivers/spi/spi-pxa2xx.c @@ -1612,7 +1612,9 @@ static int pxa2xx_spi_probe(struct platform_device *pdev) } /* Enable SOC clock */ - clk_prepare_enable(ssp->clk); + status = clk_prepare_enable(ssp->clk); + if (status) + goto out_error_dma_irq_alloc; master->max_speed_hz = clk_get_rate(ssp->clk); @@ -1716,6 +1718,8 @@ static int pxa2xx_spi_probe(struct platform_device *pdev) pm_runtime_put_noidle(&pdev->dev); pm_runtime_disable(&pdev->dev); clk_disable_unprepare(ssp->clk); + +out_error_dma_irq_alloc: pxa2xx_spi_dma_release(drv_data); free_irq(ssp->irq, drv_data); @@ -1789,8 +1793,11 @@ static int pxa2xx_spi_resume(struct device *dev) int status; /* Enable the SSP clock */ - if (!pm_runtime_suspended(dev)) - clk_prepare_enable(ssp->clk); + if (!pm_runtime_suspended(dev)) { + status = clk_prepare_enable(ssp->clk); + if (status) + return status; + } /* Restore LPSS private register bits */ if (is_lpss_ssp(drv_data)) @@ -1819,9 +1826,10 @@ static int pxa2xx_spi_runtime_suspend(struct device *dev) static int pxa2xx_spi_runtime_resume(struct device *dev) { struct driver_data *drv_data = dev_get_drvdata(dev); + int status; - clk_prepare_enable(drv_data->ssp->clk); - return 0; + status = clk_prepare_enable(drv_data->ssp->clk); + return status; } #endif -- 2.17.0