summaryrefslogtreecommitdiffstats
path: root/drivers/net
diff options
context:
space:
mode:
authorColin Ian King <colin.king@canonical.com>2017-06-21 14:25:30 +0100
committerKalle Valo <kvalo@codeaurora.org>2017-06-28 20:50:12 +0300
commit3e3d8aa611076efc945687df30a3abf181989d1d (patch)
tree7739945b83e61743afe1e1612741b380f50d4293 /drivers/net
parentb90a16854d60f147cc6388dbe3e9765101c5b5a6 (diff)
downloadlinux-stable-3e3d8aa611076efc945687df30a3abf181989d1d.tar.gz
linux-stable-3e3d8aa611076efc945687df30a3abf181989d1d.tar.bz2
linux-stable-3e3d8aa611076efc945687df30a3abf181989d1d.zip
qtnfmac: fix uninitialized return code in ret
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 <colin.king@canonical.com> Reviewed-by: Sergey Matyukevich <sergey.matyukevich.os@quantenna.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/wireless/quantenna/qtnfmac/pearl/pcie.c2
1 files changed, 1 insertions, 1 deletions
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)) {