Received: by 2002:a05:6a10:eb17:0:0:0:0 with SMTP id hx23csp517095pxb; Thu, 9 Sep 2021 06:16:54 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyaOQrhckzb0+AKmar5EPAj6kNBs0S+iAjDVvfQLk7iLEPC2X1lMrVkgdONyxF3SJaWCSjq X-Received: by 2002:a05:6638:408b:: with SMTP id m11mr2791906jam.136.1631193414630; Thu, 09 Sep 2021 06:16:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631193414; cv=none; d=google.com; s=arc-20160816; b=fRfQQWjHz0qbpG1T1hM3TCIcJ5i64DnbTTe2S+fiKaElQArSVDTTRJYEKQZSjz0xFf FffdUa86V9pzdk9n8FomtEnKoVAW/2LDaemn4fLheUYfAUd1NQ6RSvsL2TDXUe28+qmx jGW74nqduYgPXnw+b4tJ5jS+q7kecnz4+jkCQW/FjcPROlTCtTwjvtaQtY2vs5KN9Ghd cTICY8tyWjRf+UKHzhRMIaC3khV1IECKSRhsiAXV1XvN5LxjKYFIDKteEFvvyBc9DPmm syaWtF83FvEOG3hJLhGv36+OYsp+RoHf4cCjFY4MwnwMRdR9Lr0IJtuszE4Yb5Q+HTzO NVIg== 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=RiUKilaOfnccJ6RusmkPd9aNM4WxvBvE8ehtZGt9CUw=; b=mZQzlQz/x6xcDhmeUUI0g5nBauOV2yN0XmMADMGnnqIUujdnChsTqkrIqGIci3Wdve Bx24pHScjr35gE1dfYFrMgTNs4pkufew+ZyQgTDYjtnthkWkrhFiQp4bWaGQaqb59ek8 2Pvi9s8vzG6jPrCkqyD90BxBUoN/cFNDuxozpo/utWJ6x0GRK00Z0pgxywpyQC0xSUzv cVm8NCs44RAjRtHOZt7r0t14sxPkrIoHSYEfAfhG3abq/BBxoQrfhj5Zaj6o3ffZPP5X ydewgN6dgBmlJEcvhlDm9L0d+77Z2goLEket1uk4FtRlpQm8RBBjRJ3gVXXNO/P2WomZ ipeg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=or2IeWZd; 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 o12si1755560iow.40.2021.09.09.06.16.42; Thu, 09 Sep 2021 06:16: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=or2IeWZd; 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 S1356763AbhIINOs (ORCPT + 99 others); Thu, 9 Sep 2021 09:14:48 -0400 Received: from mail.kernel.org ([198.145.29.99]:43556 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1355749AbhIINDl (ORCPT ); Thu, 9 Sep 2021 09:03:41 -0400 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 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 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