Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp1733775pxb; Thu, 16 Sep 2021 14:17:33 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzO2FbgUJVrhQjBCoY6oywBpmNpPW7tb+1MiTOvv30xPY3kG4o7/XLBKU/TJHIelBJk/5eR X-Received: by 2002:a05:6e02:1c29:: with SMTP id m9mr5364992ilh.81.1631827053386; Thu, 16 Sep 2021 14:17:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631827053; cv=none; d=google.com; s=arc-20160816; b=nDj8v60DZvZyWFjRccbJ2FfoNDatq6NuOHG73nGIMaPdmGpr9AI9sTuycl/nK/htWH klNHNvSvekgKbz6EFSuoEXmtFFmTh1eGT0rAZnZuB896V+pIrHpdXN4HeRdiHgcfjcyO 5nbngLKTYiAacQREulLqJFhTwRB9cpuz1I3KfVOSE7QXv5b090T/YJ3yjTHCp9UsfRQI 93PaFNzMbbCx9U+yu/6HLhbIyFArw2J8HXW4oo5Ul6rXGpCQiIPQhBMBuvITQ90MhKAy EPOTRZpBmtNuUVPC0Yh29DmkyltCY3ciNrQPV9N/JX1vI0oLghy07MWrZP8Cxj7w3coF SkXQ== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=Di41MGPcfLKIZoR41WhmBMHrc7BzRgql6g0rQ08ghXs=; b=MHnkwnPzGBdBWxxL0tdLJQsYBitvKygiPJ2otD99Z+AOcmAqeZ6WReL1clsBpKMVrH SLhm/5mtWdeOA9mvvMDquL0E47Vp+Ba8McFaNFb9XJjrzkCZbqVDb0YB+Qrk6XmBx+Hs 2vdWTe+qHrfvA/Q4pHyqqzlspNeo6z92jCrv2fluSBkvP5DY5ClLj/Y0pIVzeOvdAPUk r9+9Yy4bOlAk89HVICbbGiytLK8y5ZqrQPSkK1p5IygUr8vuBGlE5o9fRR/WNLxF9G8s EcaoX7X7Dh2cw5UqRe+AU7bhQn0SAA5CEq2TBXIMZGhmyb8VAqLVSjGbjsn5KfuThGfb bNjQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=eQPiDCP0; 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=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id p33si3260673jac.94.2021.09.16.14.17.19; Thu, 16 Sep 2021 14:17:33 -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=@linuxfoundation.org header.s=korg header.b=eQPiDCP0; 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=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243459AbhIPQba (ORCPT + 99 others); Thu, 16 Sep 2021 12:31:30 -0400 Received: from mail.kernel.org ([198.145.29.99]:59262 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241923AbhIPQXW (ORCPT ); Thu, 16 Sep 2021 12:23:22 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 13F90614C8; Thu, 16 Sep 2021 16:15:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1631808945; bh=WANJpW8yev+oEtAtw71e8zPFe2o8jLjScIPcYNsFcsU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=eQPiDCP0MC7X7QfJrP7qIhidM+xmL9qnX+AdGQYvKM9DERdyQtONm/hXyxuIX6SmD zb3QKrGa9I4vdBLjN1ktTflZYSUTP52OHLsIRiUyVWdyfZe9eeEnsqbvuk8m16/xLP 9dmTY3ev4cN2ntXPK5xVluUxAA1plU6ppv1O2MfI= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Manish Narani , Adrian Hunter , Ulf Hansson , Sasha Levin Subject: [PATCH 5.10 248/306] mmc: sdhci-of-arasan: Check return value of non-void funtions Date: Thu, 16 Sep 2021 17:59:53 +0200 Message-Id: <20210916155802.521646122@linuxfoundation.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20210916155753.903069397@linuxfoundation.org> References: <20210916155753.903069397@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 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 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