From: Colin Ian King Date: Wed, 21 Jun 2017 13:25:30 +0000 (+0100) Subject: qtnfmac: fix uninitialized return code in ret X-Git-Tag: MMI-PSA29.97-13-9~5285^2~16^2~26 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=3e3d8aa611076efc945687df30a3abf181989d1d;p=GitHub%2FMotorolaMobilityLLC%2Fkernel-slsi.git 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 Reviewed-by: Sergey Matyukevich Signed-off-by: Kalle Valo --- 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)) {