WifiHal: Set wifi_error return code when command/operation fails

Setting the return value to corresponding error before returning
from the APIs

CRs-Fixed: 3264767
Change-Id: Id77b3d64459f4957b6921be8ad8ad4d60f32a4cb
diff --git a/qcwcn/wifi_hal/roam.cpp b/qcwcn/wifi_hal/roam.cpp
index 595fc60..bd93c3d 100644
--- a/qcwcn/wifi_hal/roam.cpp
+++ b/qcwcn/wifi_hal/roam.cpp
@@ -12,6 +12,11 @@
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
+
+ * Changes from Qualcomm Innovation Center are provided under the following license:
+
+ * Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved.
+ * SPDX-License-Identifier: BSD-3-Clause-Clear
  */
 
 #include <errno.h>
@@ -103,8 +108,10 @@
 
     /* Add the vendor specific attributes for the NL command. */
     nlData = roamCommand->attr_start(NL80211_ATTR_VENDOR_DATA);
-    if (!nlData)
+    if (!nlData){
+        ret = WIFI_ERROR_UNKNOWN;
         goto cleanup;
+    }
 
     ret = roamCommand->put_u32(QCA_WLAN_VENDOR_ATTR_ROAMING_SUBCMD,
                           QCA_WLAN_VENDOR_ROAMING_SUBCMD_SET_BLACKLIST_BSSID);
@@ -188,6 +195,7 @@
     /* Add the vendor specific attributes for the NL command. */
     nlData = roamCommand->attr_start(NL80211_ATTR_VENDOR_DATA);
     if (!nlData) {
+        ret = WIFI_ERROR_UNKNOWN;
         goto cleanup;
     }