Received: by 2002:a05:6a10:eb17:0:0:0:0 with SMTP id hx23csp459925pxb; Thu, 9 Sep 2021 05:05:54 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwlfssRR7mLAgzOFYawQreXCHjjbaJd8d1LtDFHT5IpTzjW0RU7+qvroBDR8RGfzogbzHC4 X-Received: by 2002:a17:907:384:: with SMTP id ss4mr3040098ejb.478.1631189154681; Thu, 09 Sep 2021 05:05:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631189154; cv=none; d=google.com; s=arc-20160816; b=eXhw1x9B5a8foHcnJcMEZqEtxOqNaoTipNNaZlv0IBrNn0P+A4RcvXxpG5BY+rVS0p 0sigTTZ3f7nD9ZlKuy+rXoMSJXjmT/2UD8CqsO26HP8Ene0w4SdoAzMmpXZJCrA7rP9M NZmwhVCxYE4ABoSlA5KmidzaJXx5k30Li9E8U6MPU0LF49z6qNOrLmVF96M5jCW22tvv gCLbNsiEMFsLx4HCCRTPiiJWDTC5u6atqh0p1fPhW/Agt4WLYE9WqY9FSLtxU8wY4VpZ T4LQVHZY7nn7mzO55HUXgH3BPaa8bb+mfuqovXnjMiD42GBjhidnJywN1bLWtM9Boq56 4uWQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=La5cdNWTyNi0VvKhUcoSF3Au1xyt/cX9lxoMhgG6hSA=; b=vvptMH+zob9297RfPjhWwGavYtu7w2iqm5mhpp7RuBsNV6ncU+LV7shYfGSPSMnAl2 97MZ0Fu2hGHtDwtahqNmKdHlm3IYSOKD1Jp9Cl3CURmKi/tXKqHuqJsDM6sp/lrs7Cs7 gy+30agqDu6GpdBef6iUN7hNYyybHC4HroiZGXw3yfB/DgO/Vs/mFjxYXGOjtBtvle4I c65rwiBNEjCiT/hyZqMAv1NqiKDEW/Aq1256JJjkURWgWuzkcwHOl/qU4nSnOzLsEaCH Hf72G8eIAco+miR54NDGH7L7ognQMz7W1kVA/PatCD4CusMkW/5m2KFe3hMzORm9cX7R UckQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=g5yAyhDe; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id z22si1665993ejl.373.2021.09.09.05.05.14; Thu, 09 Sep 2021 05:05:54 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=g5yAyhDe; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S245698AbhIIMBZ (ORCPT + 99 others); Thu, 9 Sep 2021 08:01:25 -0400 Received: from mail.kernel.org ([198.145.29.99]:33230 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239765AbhIIL5D (ORCPT ); Thu, 9 Sep 2021 07:57:03 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 9D83A613AD; Thu, 9 Sep 2021 11:45:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1631187932; bh=6tA3zaJCVTiAss9xOo8/mchtrsaqR7RMpruWHOFR/Jc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=g5yAyhDe/GST5WBggi9MSDbCONYvjyqQtF39FVjdrEQ6yZk9b8kPX5FSfhYI5minx KrY3DdWBqWZ9BoG+4Ngcvnxk3gOFwoCpH0wKuGt6Jq2iu8fBHEZWKOp9psxkyAAVf0 vK4ULK1LgkETF3CrW9eLIKmne/jWKU8xR/xWqhnyAmQfeVnmXCHH0uVY4J8mYMoY3X 5F7SyKSI/Dk6gOqQ93H7rPPwXMJsr+q6oFwramwIMlbZfP3x1LgjP0f3Saa0p06E+W rK/4amLSwuyN2F1nfLz9kyx7QljYN5gLMi0cTBoL7UqOBrelJKaWeM/R27MCnGW8f8 rqC5w6RM+BSDQ== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Manish Narani , Adrian Hunter , Ulf Hansson , Sasha Levin , linux-arm-kernel@lists.infradead.org, linux-mmc@vger.kernel.org Subject: [PATCH AUTOSEL 5.14 204/252] mmc: sdhci-of-arasan: Check return value of non-void funtions Date: Thu, 9 Sep 2021 07:40:18 -0400 Message-Id: <20210909114106.141462-204-sashal@kernel.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210909114106.141462-1-sashal@kernel.org> References: <20210909114106.141462-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.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 03c80c9bb7e3..b6902447d779 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