Return-path: Received: from youngberry.canonical.com ([91.189.89.112]:45774 "EHLO youngberry.canonical.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751677AbdFUNzs (ORCPT ); Wed, 21 Jun 2017 09:55:48 -0400 Subject: Re: [PATCH][net-next] qtnfmac: fix uninitialized return code in ret To: Igor Mitsyanko , Avinash Patil , Sergey Matyukevich , Kalle Valo , "David S . Miller" , Bindu Therthala , Kamlesh Rath , Sergei Maksimenko , Johannes Berg , linux-wireless@vger.kernel.org, netdev@vger.kernel.org, kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org References: <20170621132530.11937-1-colin.king@canonical.com> <20170621135402.e4iwovvmdumarzqj@bars> From: Colin Ian King Message-ID: <36a321a5-5134-9284-ca3d-663723880156@canonical.com> (sfid-20170621_155615_626357_E36117CC) Date: Wed, 21 Jun 2017 14:55:44 +0100 MIME-Version: 1.0 In-Reply-To: <20170621135402.e4iwovvmdumarzqj@bars> Content-Type: text/plain; charset=windows-1252 Sender: linux-wireless-owner@vger.kernel.org List-ID: On 21/06/17 14:54, Sergey Matyukevich wrote: >> The return value ret is unitialized and garbage is being returned >> for the three different error conditions when setting up the PCIe >> BARs. Fix this by initializing ret to -ENOMEM to indicate that >> the BARs failed to be setup correctly. >> >> Detected by CoverityScan, CID#1437563 ("Unitialized scalar variable") >> >> Signed-off-by: Colin Ian King >> --- >> drivers/net/wireless/quantenna/qtnfmac/pearl/pcie.c | 2 +- >> 1 file changed, 1 insertion(+), 1 deletion(-) >> >> diff --git a/drivers/net/wireless/quantenna/qtnfmac/pearl/pcie.c b/drivers/net/wireless/quantenna/qtnfmac/pearl/pcie.c >> index f93b27f3a236..7fc4f0d6a9ad 100644 >> --- a/drivers/net/wireless/quantenna/qtnfmac/pearl/pcie.c >> +++ b/drivers/net/wireless/quantenna/qtnfmac/pearl/pcie.c >> @@ -247,7 +247,7 @@ static void qtnf_pcie_free_shm_ipc(struct qtnf_pcie_bus_priv *priv) >> >> static int qtnf_pcie_init_memory(struct qtnf_pcie_bus_priv *priv) >> { >> - int ret; >> + int ret = -ENOMEM; >> >> priv->sysctl_bar = qtnf_map_bar(priv, QTN_SYSCTL_BAR); >> if (IS_ERR_OR_NULL(priv->sysctl_bar)) { >> -- > > Thanks ! > > Reviewed-by: Sergey Matyukevich > > By the way, could you please use the recepient list suggested by > get_maintainer.pl script from the kernel scripts directory. Yep, I did. > > Regards, > Sergey >