diff --git a/core/hdd/src/wlan_hdd_debugfs_llstat.c b/core/hdd/src/wlan_hdd_debugfs_llstat.c index 7db85b6026d1..eb2ebd62b781 100644 --- a/core/hdd/src/wlan_hdd_debugfs_llstat.c +++ b/core/hdd/src/wlan_hdd_debugfs_llstat.c @@ -428,7 +428,7 @@ static int __wlan_hdd_open_ll_stats_debugfs(struct inode *inode, { struct hdd_adapter *adapter; struct hdd_context *hdd_ctx; - int ret; + int errno; hdd_enter(); @@ -436,23 +436,22 @@ static int __wlan_hdd_open_ll_stats_debugfs(struct inode *inode, file->private_data = inode->i_private; adapter = (struct hdd_adapter *)file->private_data; - if (!adapter || WLAN_HDD_ADAPTER_MAGIC != adapter->magic) { - hdd_err("Invalid adapter or adapter has invalid magic"); - return -EINVAL; - } + errno = hdd_validate_adapter(adapter); + if (errno) + return errno; hdd_ctx = WLAN_HDD_GET_CTX(adapter); - ret = wlan_hdd_validate_context(hdd_ctx); - if (ret) - return ret; + errno = wlan_hdd_validate_context(hdd_ctx); + if (errno) + return errno; - ret = wlan_hdd_llstats_alloc_buf(); - if (ret) - return ret; + errno = wlan_hdd_llstats_alloc_buf(); + if (errno) + return errno; - ret = wlan_hdd_ll_stats_get(adapter, DEBUGFS_LLSTATS_REQID, - DEBUGFS_LLSTATS_REQMASK); - if (ret) + errno = wlan_hdd_ll_stats_get(adapter, DEBUGFS_LLSTATS_REQID, + DEBUGFS_LLSTATS_REQMASK); + if (errno) goto free_buf; hdd_exit(); @@ -464,7 +463,7 @@ free_buf: hdd_exit(); - return ret; + return errno; } /** diff --git a/core/hdd/src/wlan_hdd_stats.c b/core/hdd/src/wlan_hdd_stats.c index bc079b3a2aa6..bc04117c8159 100644 --- a/core/hdd/src/wlan_hdd_stats.c +++ b/core/hdd/src/wlan_hdd_stats.c @@ -1407,7 +1407,7 @@ exit: int wlan_hdd_ll_stats_get(struct hdd_adapter *adapter, uint32_t req_id, uint32_t req_mask) { - int ret; + int errno; tSirLLStatsGetReq get_req; struct hdd_station_ctx *hddstactx = WLAN_HDD_GET_STATION_CTX_PTR(adapter); struct hdd_context *hdd_ctx = WLAN_HDD_GET_CTX(adapter); @@ -1419,10 +1419,6 @@ int wlan_hdd_ll_stats_get(struct hdd_adapter *adapter, uint32_t req_id, return -EPERM; } - ret = wlan_hdd_validate_context(hdd_ctx); - if (0 != ret) - return -EINVAL; - if (hddstactx->hdd_reassoc_scenario) { hdd_err("Roaming in progress, cannot process the request"); return -EBUSY; @@ -1438,15 +1434,15 @@ int wlan_hdd_ll_stats_get(struct hdd_adapter *adapter, uint32_t req_id, get_req.staId = adapter->session_id; rtnl_lock(); - ret = wlan_hdd_send_ll_stats_req(hdd_ctx, &get_req); + errno = wlan_hdd_send_ll_stats_req(hdd_ctx, &get_req); rtnl_unlock(); - if (0 != ret) + if (errno) hdd_err("Send LL stats req failed, id:%u, mask:%d, session:%d", req_id, req_mask, adapter->session_id); hdd_exit(); - return ret; + return errno; } /**