From 7dac923e1eda856ee423bccca983f12577cc46d7 Mon Sep 17 00:00:00 2001 From: Nachiket Kukade Date: Thu, 8 Nov 2018 20:16:49 +0530 Subject: [PATCH] qcacld-3.0: Return appropriate status code in sme_nan_request After the NAN request message is posted to the SME queue in sme_nan_request, the status of the scheduler API is ignored. Success will be returned in the case of a failure during posting the message. This may generate unexpected outcomes during NAN testcases. Return appropriate status code in sme_nan_request to the caller. Change-Id: I31f518e7b90315c0f7c30ec2f5aeebec19d64813 CRs-Fixed: 2335734 --- core/sme/src/nan/nan_api.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/core/sme/src/nan/nan_api.c b/core/sme/src/nan/nan_api.c index 43ac3af91021..2b9e8151995d 100644 --- a/core/sme/src/nan/nan_api.c +++ b/core/sme/src/nan/nan_api.c @@ -50,6 +50,7 @@ void sme_nan_deregister_callback(mac_handle_t mac_handle) QDF_STATUS sme_nan_request(tpNanRequestReq input) { struct scheduler_msg msg = {0}; + QDF_STATUS status; tpNanRequest data; size_t data_len; @@ -68,16 +69,15 @@ QDF_STATUS sme_nan_request(tpNanRequestReq input) msg.reserved = 0; msg.bodyptr = data; - if (QDF_STATUS_SUCCESS != scheduler_post_message(QDF_MODULE_ID_SME, - QDF_MODULE_ID_WMA, - QDF_MODULE_ID_WMA, - &msg)) { + status = scheduler_post_message(QDF_MODULE_ID_SME, QDF_MODULE_ID_WMA, + QDF_MODULE_ID_WMA, &msg); + + if (QDF_IS_STATUS_ERROR(status)) { sme_err("Not able to post WMA_NAN_REQUEST message to WMA"); qdf_mem_free(data); - return QDF_STATUS_SUCCESS; } - return QDF_STATUS_SUCCESS; + return status; } void sme_nan_event(mac_handle_t mac_handle, tSirNanEvent *event)