From f25ac101448d4187af581153e01d1a8eff89add4 Mon Sep 17 00:00:00 2001 From: Jeff Johnson Date: Tue, 7 Feb 2017 09:16:02 -0800 Subject: [PATCH] qcacld-3.0: Fix bad return status from __iw_get_bitrate() There are currently several error paths in __iw_get_bitrate() which incorrectly return internal status enumerations instead of returning negative errno values. Fix these paths to correctly return negative errno values. Change-Id: I42254dbe1b362fb42b87418419b97ccbabfac355 CRs-Fixed: 2004190 --- core/hdd/src/wlan_hdd_wext.c | 19 ++++++------------- 1 file changed, 6 insertions(+), 13 deletions(-) diff --git a/core/hdd/src/wlan_hdd_wext.c b/core/hdd/src/wlan_hdd_wext.c index 2b49c2d7010f..4d68d78741bd 100644 --- a/core/hdd/src/wlan_hdd_wext.c +++ b/core/hdd/src/wlan_hdd_wext.c @@ -3137,8 +3137,7 @@ static int __iw_get_bitrate(struct net_device *dev, struct iw_request_info *info, union iwreq_data *wrqu, char *extra) { - QDF_STATUS qdf_status = QDF_STATUS_SUCCESS; - QDF_STATUS status = QDF_STATUS_SUCCESS; + QDF_STATUS status; hdd_wext_state_t *pWextState; hdd_adapter_t *pAdapter = WLAN_HDD_GET_PRIV_PTR(dev); hdd_station_ctx_t *pHddStaCtx = WLAN_HDD_GET_STATION_CTX_PTR(pAdapter); @@ -3152,12 +3151,6 @@ static int __iw_get_bitrate(struct net_device *dev, if (0 != ret) return ret; - if (cds_is_driver_recovering()) { - hdd_alert("Recovery in Progress. State: 0x%x Ignore!!!", - cds_get_driver_state()); - return status; - } - if (eConnectionState_Associated != pHddStaCtx->conn_info.connState) { wrqu->bitrate.value = 0; } else { @@ -3177,18 +3170,18 @@ static int __iw_get_bitrate(struct net_device *dev, if (QDF_STATUS_SUCCESS != status) { hdd_err("Unable to retrieve statistics"); - return status; + return qdf_status_to_os_return(status); } pWextState = WLAN_HDD_GET_WEXT_STATE_PTR(pAdapter); - qdf_status = + status = qdf_wait_single_event(&pWextState->hdd_qdf_event, WLAN_WAIT_TIME_STATS); - if (!QDF_IS_STATUS_SUCCESS(qdf_status)) { + if (!QDF_IS_STATUS_SUCCESS(status)) { hdd_err("SME timeout while retrieving statistics"); - return QDF_STATUS_E_FAILURE; + return qdf_status_to_os_return(status); } wrqu->bitrate.value = @@ -3197,7 +3190,7 @@ static int __iw_get_bitrate(struct net_device *dev, EXIT(); - return qdf_status; + return 0; } /**