From 3dc2dab9041e966e441200dfe6d5495fb0646e64 Mon Sep 17 00:00:00 2001 From: Hsiu-Chang Chen Date: Mon, 5 Sep 2022 13:29:27 +0800 Subject: WifiHal: Set wifi_error return code when command/operation fails Setting the return value to corresponding error before returning from the APIs. Bug: 241058906 Test: VTS test CRs-Fixed: 3264767 Change-Id: Id77b3d64459f4957b6921be8ad8ad4d60f32a4cb --- wcn6740/qcwcn/wifi_hal/wifihal_vendor.cpp | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) (limited to 'wcn6740/qcwcn/wifi_hal/wifihal_vendor.cpp') diff --git a/wcn6740/qcwcn/wifi_hal/wifihal_vendor.cpp b/wcn6740/qcwcn/wifi_hal/wifihal_vendor.cpp index e94506f..4837e63 100644 --- a/wcn6740/qcwcn/wifi_hal/wifihal_vendor.cpp +++ b/wcn6740/qcwcn/wifi_hal/wifihal_vendor.cpp @@ -25,6 +25,11 @@ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + * 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 "sync.h" @@ -543,8 +548,10 @@ wifi_error wifi_get_nud_stats(wifi_interface_handle iface, goto cleanup; /*add the attributes*/ nl_data = NUDCommand->attr_start(NL80211_ATTR_VENDOR_DATA); - if (!nl_data) + if (!nl_data){ + ret = WIFI_ERROR_UNKNOWN; goto cleanup; + } /**/ NUDCommand->attr_end(nl_data); @@ -593,13 +600,17 @@ wifi_error wifi_clear_nud_stats(wifi_interface_handle iface, /*add the attributes*/ nl_data = NUDCommand->attr_start(NL80211_ATTR_VENDOR_DATA); - if (!nl_data) + if (!nl_data){ + ret = WIFI_ERROR_UNKNOWN; goto cleanup; + } if (mData.pkt_Type) { /*set the packet info attributes in nested*/ nl_pktInfo = NUDCommand->attr_start(QCA_ATTR_NUD_STATS_SET_DATA_PKT_INFO); - if (!nl_pktInfo) + if (!nl_pktInfo){ + ret = WIFI_ERROR_UNKNOWN; goto cleanup; + } else { ALOGV(" %s: pkt_type %d domain_name :%s" " src_port %d dst_port :%d" -- cgit v1.2.3