Wlan: Return non-positive value from get firmware memory dump to hal

The get fw mem dump return 1 to wifi hal, in case of success.
This leads to wifi hal thread stuck and thus though the driver is
in disconnected state GUI show it as connected.

To avoid this return 0 for success and negative value for failure
from get fw mem dump.

Change-Id: Ic93a404ffe1a10401dc9cf31e620acdd71ca61de
CRs-Fixed: 949265
diff --git a/CORE/HDD/src/wlan_hdd_cfg80211.c b/CORE/HDD/src/wlan_hdd_cfg80211.c
index 8a1ab9c..dc655c1 100644
--- a/CORE/HDD/src/wlan_hdd_cfg80211.c
+++ b/CORE/HDD/src/wlan_hdd_cfg80211.c
@@ -5826,7 +5826,7 @@
     /*call common API for FW mem dump req*/
     ret = wlan_hdd_fw_mem_dump_req(pHddCtx);
 
-    if (true == ret)
+    if (!ret)
     {
         /*indicate to userspace the status of fw mem dump */
         wlan_indicate_mem_dump_complete(true);
diff --git a/CORE/HDD/src/wlan_hdd_main.c b/CORE/HDD/src/wlan_hdd_main.c
index e0585e8..80f50c5 100755
--- a/CORE/HDD/src/wlan_hdd_main.c
+++ b/CORE/HDD/src/wlan_hdd_main.c
@@ -12738,7 +12738,7 @@
    tAniFwrDumpReq fw_mem_dump_req={0};
    struct hdd_fw_mem_dump_req_ctx fw_mem_dump_ctx;
    eHalStatus status = eHAL_STATUS_FAILURE;
-   int ret=0;
+   int ret=0, result;
    ENTER();
 
    /*Check whether a dump request is already going on
@@ -12774,19 +12774,24 @@
        goto cleanup;
    }
    /*wait for fw mem dump completion to send event to userspace*/
-   ret = wait_for_completion_timeout(&fw_mem_dump_ctx.req_completion,msecs_to_jiffies(FW_MEM_DUMP_TIMEOUT_MS));
-   if (0 >= ret )
+   result =
+     wait_for_completion_timeout(&fw_mem_dump_ctx.req_completion,
+                            msecs_to_jiffies(FW_MEM_DUMP_TIMEOUT_MS));
+   if (0 >= result )
    {
       hddLog(VOS_TRACE_LEVEL_ERROR,
-          "%s: fw_mem_dump_req timeout %d ", __func__,ret);
+          "%s: fw_mem_dump_req timeout %d ", __func__,result);
+      ret = -ETIMEDOUT;
    }
 cleanup:
    spin_lock(&hdd_context_lock);
    fw_mem_dump_ctx.magic = 0;
+   if(!ret && !fw_mem_dump_ctx.status)
+      ret = -EFAULT;
    spin_unlock(&hdd_context_lock);
 
    EXIT();
-   return fw_mem_dump_ctx.status;
+   return ret;
 }
 
 /**