wlan: Fix to return proper value from wlan_hdd_scan_abort
Function wlan_hdd_scan_abort() returns uninitialised status
value in case pScanInfo->mScanPending is false. This causes
unintended termination of PNO sched scan.
Initialised the status variable and added proper handling of
the returned value from this function.
Change-Id: I01d5806be2827659c5b2d210a08a85766f557177
CRs-Fixed: 675863
diff --git a/CORE/HDD/src/wlan_hdd_main.c b/CORE/HDD/src/wlan_hdd_main.c
index c766bc7..621b5b1 100644
--- a/CORE/HDD/src/wlan_hdd_main.c
+++ b/CORE/HDD/src/wlan_hdd_main.c
@@ -318,7 +318,7 @@
case NETDEV_GOING_DOWN:
result = wlan_hdd_scan_abort(pAdapter);
- if (result <= 0)
+ if (result < 0)
{
VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR,
"%s: Timeout occurred while waiting for abortscan %ld",
@@ -10002,7 +10002,7 @@
{
hdd_context_t *pHddCtx = WLAN_HDD_GET_CTX(pAdapter);
hdd_scaninfo_t *pScanInfo = NULL;
- int status;
+ long status = 0;
pScanInfo = &pHddCtx->scan_info;
if (pScanInfo->mScanPending)
@@ -10014,15 +10014,15 @@
status = wait_for_completion_interruptible_timeout(
&pScanInfo->abortscan_event_var,
msecs_to_jiffies(5000));
- if ((!status) || (status == -ERESTARTSYS))
+ if (0 >= status)
{
VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR,
- "%s: Timeout occurred while waiting for abort scan",
- __func__);
+ "%s: Timeout or Interrupt occurred while waiting for abort"
+ "scan, status- %ld", __func__, status);
return -ETIMEDOUT;
}
}
- return status;
+ return 0;
}
//Register the module init/exit functions