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 5710CC433F5 for ; Thu, 9 Sep 2021 13:02:13 +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 2A53260ED8 for ; Thu, 9 Sep 2021 13:02:13 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 2A53260ED8 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=3QpQ1uzz8vfDfO+CTxMYnS39kYPEEuhHyGhPkz/DkTM=; b=c1iw0J00gNIBLL j8K/hgLwsy/5UlBmYPFFSrV5clldMgbeyIwy08J9ezz/WS68D8X57xh4rBl7qX++fUcb+avogo3z6 4YNjj/rKgnlesJdGHwvnLaq8n3PufwKtqYVGFph03238jpKmcaxsnCjqkM5W4aJtb2BzFLqs/5BNO 0gqmFh5ZP1gnQDxoScBUVVNLrw+t3h5paPZ2seHk2BJ2Q23OKEw4+Sb6JqRd97ewkHqTLERZCblkZ r2xlzsguSwe6IQ3a3HGkmVA3mscUh0iPApF7Lp+Q7p1qVectRvWNAjihEnw3CjFnq7xDdXWM5uG8g 1wcp7whkX3a277PkZeqA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mOJfF-009fLg-VO; Thu, 09 Sep 2021 13:00:26 +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 1mOIdQ-009AWP-Uo for linux-arm-kernel@lists.infradead.org; Thu, 09 Sep 2021 11:54:30 +0000 Received: by mail.kernel.org (Postfix) with ESMTPSA id C0E9C6138E; Thu, 9 Sep 2021 11:54:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1631188468; bh=WANJpW8yev+oEtAtw71e8zPFe2o8jLjScIPcYNsFcsU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ArpcGNYZyb3VGTE26eK1/dXVcQeu1JHFTILAkd5EAzOnOv4ollSGTtRGbyy3S5joV Tq56IFq8epMRYTKV510UYm/HwFlswQeLCuZmMH5kxHpLvAGMhZ7ZPeFH4dNicpVlG6 o3k20FiE0cqAG9z7d6BC/85YfdjRdCf1loZHUUYwpSFdO8gLoZQKKDnN61+vsnj2P3 zhv+1uz8n5UHAiTusQ6mOnZLndOq8Xda1MsKdYSWS4y4Cdcd9VYgXCFxvxnMjyP8tD 9CXRUD17siD1tbJoS2Z4a7to/GYQy3Tm2A5vgGtZuiJgMYC6unRuonliEN/UMw50pG P+1cDsOyeXu/w== 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 5.10 147/176] mmc: sdhci-of-arasan: Check return value of non-void funtions Date: Thu, 9 Sep 2021 07:50:49 -0400 Message-Id: <20210909115118.146181-147-sashal@kernel.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210909115118.146181-1-sashal@kernel.org> References: <20210909115118.146181-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_045429_106986_E9010E5F X-CRM114-Status: GOOD ( 12.10 ) 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 0c5479a06e9e..fc38db64a6b4 100644 --- a/drivers/mmc/host/sdhci-of-arasan.c +++ b/drivers/mmc/host/sdhci-of-arasan.c @@ -273,7 +273,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; /* @@ -323,7 +328,12 @@ static void sdhci_arasan_set_clock(struct sdhci_host *host, unsigned int clock) msleep(20); 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; } } @@ -479,7 +489,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