Received: by 2002:a05:6520:4d:b0:139:a872:a4c9 with SMTP id i13csp2566976lkm; Mon, 20 Sep 2021 18:54:18 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy3TyFe+ZFdRyQeVoXehgHdI5Ktb/Bfbvcs78E40C1p4nB84rKrdlnimBUM7KBPQ47iFxrQ X-Received: by 2002:a05:6e02:1bc9:: with SMTP id x9mr20093416ilv.168.1632189258206; Mon, 20 Sep 2021 18:54:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1632189258; cv=none; d=google.com; s=arc-20160816; b=w9/YijXwIU71xo90d0aKpHoxD8iYYJ6nbFSEQeUxZPNgsOrE95JWM9U91CFvcE1cIx 2CCOLhfHqMgGq0pLsWI0MCuSa1fN2L1ZgnJzf3ou2ScNwQKgGiatB3ZbEEHdI25wvgTi JaH5gJ+RxumHPaCNqGfzA5dEIpI4ADyhR+K5r4kxTGBauxl9dtjUcn3QlASo8yNsgUYJ VQZlWVMoFqQHttMWp42i5z2pF/VqFIQvgSwbuEkH228BPEIfq4+4fBa5nfX+eX2UYWw5 LFwgBi+JrLZOQkkK2w2FoUDIHjgyjNXG2J+xW+7jS7/AFkv5HkqLYsLET82erhUbnFgo +zqg== 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=HPKWe7k5B5M8yYKwoecZ0p+3lAciHDEBx8zJN802q6M=; b=Y3Zxa1iBxaKAm6snKS9VHjAC6mhJhDMFRgQ++4pB7D2PHJh5aZurIoCjT3UrA5qQF7 d1sw83jYn6WknjHG+xkbX68nCgtrsLT1XXLmjMhakr9VPJIivT0MjhgDApqkGsyfQTbo iDPv9C6a0WKqmkyZnrIf+ZS4GAf0ThPD1f18x0ER6e9ICQPpb5VJI554wBlbHnWzFNaJ ycVOMdKU0vIDpTilqJ8Qvc2cFwb8zSIMEiUG405ebWlcZdVeOJnqoxhSi+bSUu0peZFT 5WfqOfgjJn0vGAhI8zcETg7wapSo1qPG851sC5Hd92xHTAscArJJH/cac5B1KouzpVlF ONTA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="ES/dwKZM"; 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 m3si9091541ilh.180.2021.09.20.18.54.07; Mon, 20 Sep 2021 18:54:18 -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="ES/dwKZM"; 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 S1351484AbhITSSQ (ORCPT + 99 others); Mon, 20 Sep 2021 14:18:16 -0400 Received: from mail.kernel.org ([198.145.29.99]:35802 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1376429AbhITSMS (ORCPT ); Mon, 20 Sep 2021 14:12:18 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 9E3126135A; Mon, 20 Sep 2021 17:20:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1632158445; bh=vDSZq9lXefbQa4pN+legL2Fc11z3otO4Mk1OIn1/z2Q=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ES/dwKZMq5nArs4cyzRTVrQIROeDndB020zsGH8cBPLbbaq766+ZfOvoQq3vfFL/e BPGjwQady3T1GcjVooCY/acmke16iMMKQQegpijOZO1UJoh0a+HmUAeyl1qPRH/2DU tqDteTmKBBEUQuY9lZprIlC8udfpIZXHFELyuDrg= 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.4 152/260] mmc: sdhci-of-arasan: Check return value of non-void funtions Date: Mon, 20 Sep 2021 18:42:50 +0200 Message-Id: <20210920163936.278851285@linuxfoundation.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20210920163931.123590023@linuxfoundation.org> References: <20210920163931.123590023@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 7023cbec4017..dd10f7abf5a7 100644 --- a/drivers/mmc/host/sdhci-of-arasan.c +++ b/drivers/mmc/host/sdhci-of-arasan.c @@ -192,7 +192,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; /* @@ -228,7 +233,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; } } @@ -416,7 +426,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