Received: by 2002:a05:6a10:eb17:0:0:0:0 with SMTP id hx23csp508314pxb; Thu, 9 Sep 2021 06:07:10 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzdcLSvYH+OBLLofTdpWi20uve3RxCPM6fnQi/fNlvykIwOD68MbB3XNZEp3hvrehoUtZRt X-Received: by 2002:a2e:a788:: with SMTP id c8mr2172794ljf.116.1631192829701; Thu, 09 Sep 2021 06:07:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631192829; cv=none; d=google.com; s=arc-20160816; b=K5J5GyfJxTHONRZAuwrmwMJVoLZwDlJcZJEe6nHGnlvxAjiKGnG0TGFE+PxqDaMbGM VFvcs+dz3YmDmb+N5ZLus6PT5a3QPb4vmMkRcHVCG0d26FeW3Tod+zrdsv0vCGHYM/bf CNeKHNtV3XmnCbouB2SYkdjW46MpLla2vWVePDDGGbHPrOf8+nlv4vkbNoPKaLYBav5L LdIDSLpvWzuArY5LNa/2G/Ct8f2H5tdwMXY6tIAzI581pjDG0iwT68lsSn/OI0TbDYAj CcM719reZYO732L9HFyv/Q7cdMzF5HNrPjREpkt6TBSKMVSoBYqUpxwiTQAy7whBM3GS evLg== 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=HPKWe7k5B5M8yYKwoecZ0p+3lAciHDEBx8zJN802q6M=; b=i9FpQ6Tg5rBUi+w7qjxWinitFlbRxYESnSQUpr26dGV9ncB8+PofTfvNoysVwJPU6q jjb0L12vQlr5YDNUTPqZ6zN3FbBYEaFHHpodGWqYYMugSG2OYKdcfZ7ow5H3K9jHPBwD kywtlfEzyBD7CgUxzITxT5iQxGmFDc+9s623J/i3sp5wHcDWUNHdo2Lzio+EQaKoBf3d WLIAqC9imx39weVO32UMyH5DW2BJE3LISBFrHKduDcmT1JKUrIXs0JVGIhroh04um+wJ QD1yIlajuR2EPR3T5AH5bQkwlDqSt0SD0Rnno5qOIdXfpKEXE5p+2QVFoQq4AXAtX4ir CxaQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=kswq3lnL; 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 z44si1889115ede.483.2021.09.09.06.06.35; Thu, 09 Sep 2021 06:07:09 -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=kswq3lnL; 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 S1357511AbhIINBj (ORCPT + 99 others); Thu, 9 Sep 2021 09:01:39 -0400 Received: from mail.kernel.org ([198.145.29.99]:42578 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1355328AbhIIMtm (ORCPT ); Thu, 9 Sep 2021 08:49:42 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 414E963232; Thu, 9 Sep 2021 11:56:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1631188619; bh=vDSZq9lXefbQa4pN+legL2Fc11z3otO4Mk1OIn1/z2Q=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=kswq3lnLFv0q1o5YmUBb0H4NpXGiK+brtR3o9UzKnwiGQW6N5kfC8ykCzzbWQvsGc oJCph9/Gy7rtfyselirZoIIOmoup6XAiy77FqMvRyPy9WM7uPK6DkENdG3TxgtEd5d /n06nvTY31gs/ElYXl0i4AjfbOJcCVcyUmyCRBTKFkXEEjJQUTlxQlgQvcko+6GHpK gN/vHh7XvqclR8U88T14iG7oHc/o3njN5nd0HC6baApVbHM6xaZwm9R+miAuiKnt6v kUYfCzBz6XKXf0LisJ+63L5+LUSjQ1KdAJ0AQlJQVJajhfVDHLF3BQ5uwtB9SWV1zx 4ISh67lcbZ0cQ== 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.4 088/109] mmc: sdhci-of-arasan: Check return value of non-void funtions Date: Thu, 9 Sep 2021 07:54:45 -0400 Message-Id: <20210909115507.147917-88-sashal@kernel.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210909115507.147917-1-sashal@kernel.org> References: <20210909115507.147917-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 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