From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-17.4 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id DB326C433F5 for ; Thu, 9 Sep 2021 13:24:37 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id A3D23610E8 for ; Thu, 9 Sep 2021 13:24:37 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org A3D23610E8 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=FGfQU08AYX/EpihhCf6GXB6JbTBebeO8J0DUywT1Wr4=; b=PXF5X8WFE8e8vv ucx9Iuxg1Qu9yqqiiNeoQhBEbyINowpYlFiVvE9a0i/po+YSRC/vRKm5mlgxDxWdSreMMPV5sHRH0 22G4NprtEtuwXHqyv6NVFsfUc6yQP6EZM/6E1FyhPq+jA3q0HoKzCQq8IQlcN5uDPTwowKS16PpZC C8G/2fs1oT5Uz0sQ3Ruhe1FK4yCxlUWIgeL6CkC7DAirSP87dcNxrKmHQP0PJVhkGrhWfDv94OPHZ 9+bnF7XdCPMHpsNnZSlEeN+pBxFvFOo5EBV7QaR4Jn7U2qJkt/APP3jwl8lJamJWA6llKNGn3aSCW LbyRnx5/u8Zq6wWHXuFA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mOK0u-009pDd-V0; Thu, 09 Sep 2021 13:22:49 +0000 Received: from mail.kernel.org ([198.145.29.99]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mOIij-009DSb-Cc for linux-arm-kernel@lists.infradead.org; Thu, 09 Sep 2021 11:59:58 +0000 Received: by mail.kernel.org (Postfix) with ESMTPSA id 31F3A613A9; Thu, 9 Sep 2021 11:59:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1631188797; bh=QhooalOgWW49qZl8J/37pLdaeJN9fzNjSgUG6nMpwMM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=or2IeWZdQFT+nPvXPUHRNudbiNuQ8aedSLVWD9zuHWLjcKiIwnIlIRYimRD8wCkLM 6ez6f7PDpft6OnBCwHaW7jlrmacsn73SfZIsfF/l7wbgSUaqYP9dhA3r7iIx0iJ3tg UKzB53y/paZl5c+JItG2uVt5yLxAf6rpuImcsUKX9MNftmzVRWZ5I3L6Nc6RzACyPH OgxSikZrP0T0GyecVBE0nEA99gJclPpjfSuY0x3+IK7Ow0gT+NVxKuePrb7BhAcoJJ Re932eonID81GrQ1b0G13fQv3jJKS4tjE+UhbM4ttOZezUrzPpjTNZlRipltyAIHUa JQegkdTCCGlDw== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Manish Narani , Adrian Hunter , Ulf Hansson , Sasha Levin , linux-mmc@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH AUTOSEL 4.14 45/59] mmc: sdhci-of-arasan: Check return value of non-void funtions Date: Thu, 9 Sep 2021 07:58:46 -0400 Message-Id: <20210909115900.149795-45-sashal@kernel.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210909115900.149795-1-sashal@kernel.org> References: <20210909115900.149795-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210909_045957_485208_289ECF71 X-CRM114-Status: GOOD ( 12.31 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org From: Manish Narani [ Upstream commit 66bad6ed2204fdb78a0a8fb89d824397106a5471 ] At a couple of places, the return values of the non-void functions were not getting checked. This was reported by the coverity tool. Modify the code to check the return values of the same. Addresses-Coverity: ("check_return") Signed-off-by: Manish Narani Acked-by: Adrian Hunter Link: https://lore.kernel.org/r/1623753837-21035-5-git-send-email-manish.narani@xilinx.com Signed-off-by: Ulf Hansson Signed-off-by: Sasha Levin --- drivers/mmc/host/sdhci-of-arasan.c | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/drivers/mmc/host/sdhci-of-arasan.c b/drivers/mmc/host/sdhci-of-arasan.c index e033ad477715..0a2bfd034df3 100644 --- a/drivers/mmc/host/sdhci-of-arasan.c +++ b/drivers/mmc/host/sdhci-of-arasan.c @@ -179,7 +179,12 @@ static void sdhci_arasan_set_clock(struct sdhci_host *host, unsigned int clock) * through low speeds without power cycling. */ sdhci_set_clock(host, host->max_clk); - phy_power_on(sdhci_arasan->phy); + if (phy_power_on(sdhci_arasan->phy)) { + pr_err("%s: Cannot power on phy.\n", + mmc_hostname(host->mmc)); + return; + } + sdhci_arasan->is_phy_on = true; /* @@ -205,7 +210,12 @@ static void sdhci_arasan_set_clock(struct sdhci_host *host, unsigned int clock) sdhci_set_clock(host, clock); if (ctrl_phy) { - phy_power_on(sdhci_arasan->phy); + if (phy_power_on(sdhci_arasan->phy)) { + pr_err("%s: Cannot power on phy.\n", + mmc_hostname(host->mmc)); + return; + } + sdhci_arasan->is_phy_on = true; } } @@ -305,7 +315,9 @@ static int sdhci_arasan_suspend(struct device *dev) ret = phy_power_off(sdhci_arasan->phy); if (ret) { dev_err(dev, "Cannot power off phy.\n"); - sdhci_resume_host(host); + if (sdhci_resume_host(host)) + dev_err(dev, "Cannot resume host.\n"); + return ret; } sdhci_arasan->is_phy_on = false; -- 2.30.2 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel