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
diff --git a/core/sme/src/nan/nan_api.c b/core/sme/src/nan/nan_api.c
index 43ac3af..2b9e815 100644
--- a/core/sme/src/nan/nan_api.c
+++ b/core/sme/src/nan/nan_api.c
@@ -50,6 +50,7 @@
 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 @@
 	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)