Explorar el Código

qcacmn: Remove repetitive logs for mem alloc failure in scan

Qdf alloc api print the log in case of alloc failure and thus
the caller doesn't need to print the error again.

Remove the repetitive logs from wlan_scan_process_bcn_probe_rx_sync
and tgt_scan_bcn_probe_rx_callback. And fix check patch errors.

Change-Id: Ia340b71b5b476339d2ffe68b287b894ff6b532e8
CRs-Fixed: 2435932
Abhishek Singh hace 6 años
padre
commit
a7bfb9b1b4

+ 4 - 3
umac/scan/core/src/wlan_scan_cache_db.h

@@ -67,7 +67,8 @@ struct scan_bcn_probe_event {
  * scm_handle_bcn_probe() - Process beacon and probe rsp
  * @msg: schedular msg with bcn info;
  *
- * API to handle the beacon/probe resp
+ * API to handle the beacon/probe resp. msg->bodyptr will be consumed and freed
+ * by this func
  *
  * Return: QDF status.
  */
@@ -77,13 +78,13 @@ QDF_STATUS scm_handle_bcn_probe(struct scheduler_msg *msg);
  * __scm_handle_bcn_probe() - Process beacon and probe rsp
  * @bcn: beacon info;
  *
- * API to handle the beacon/probe resp
+ * API to handle the beacon/probe resp. bcn will be consumed and freed by this
+ * func
  *
  * Return: QDF status.
  */
 QDF_STATUS __scm_handle_bcn_probe(struct scan_bcn_probe_event *bcn);
 
-
 /**
  * scm_age_out_entries() - Age out entries older than aging time
  * @psoc: psoc pointer

+ 2 - 4
umac/scan/dispatcher/src/wlan_scan_api.c

@@ -186,22 +186,20 @@ wlan_scan_process_bcn_probe_rx_sync(struct wlan_objmgr_psoc *psoc,
 	QDF_STATUS status;
 
 	if ((frm_type != MGMT_PROBE_RESP) &&
-	   (frm_type != MGMT_BEACON)) {
+	    (frm_type != MGMT_BEACON)) {
 		scm_err("frame is not beacon or probe resp");
 		status = QDF_STATUS_E_INVAL;
 		goto free;
 	}
-	bcn = qdf_mem_malloc_atomic(sizeof(*bcn));
 
+	bcn = qdf_mem_malloc_atomic(sizeof(*bcn));
 	if (!bcn) {
-		scm_debug_rl("Failed to allocate memory for bcn");
 		status = QDF_STATUS_E_NOMEM;
 		goto free;
 	}
 	bcn->rx_data =
 		qdf_mem_malloc_atomic(sizeof(*rx_param));
 	if (!bcn->rx_data) {
-		scm_debug_rl("Failed to allocate memory for rx_data");
 		status = QDF_STATUS_E_NOMEM;
 		goto free;
 	}

+ 3 - 5
umac/scan/dispatcher/src/wlan_scan_tgt_api.c

@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2017-2018 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2017-2019 The Linux Foundation. All rights reserved.
  *
  * Permission to use, copy, modify, and/or distribute this software for
  * any purpose with or without fee is hereby granted, provided that the
@@ -264,22 +264,20 @@ QDF_STATUS tgt_scan_bcn_probe_rx_callback(struct wlan_objmgr_psoc *psoc,
 	uint32_t scan_queue_size = 0;
 
 	if ((frm_type != MGMT_PROBE_RESP) &&
-	   (frm_type != MGMT_BEACON)) {
+	    (frm_type != MGMT_BEACON)) {
 		scm_err("frame is not beacon or probe resp");
 		status = QDF_STATUS_E_INVAL;
 		goto free;
 	}
-	bcn = qdf_mem_malloc_atomic(sizeof(*bcn));
 
+	bcn = qdf_mem_malloc_atomic(sizeof(*bcn));
 	if (!bcn) {
-		scm_debug_rl("Failed to allocate memory for bcn");
 		status = QDF_STATUS_E_NOMEM;
 		goto free;
 	}
 	bcn->rx_data =
 		qdf_mem_malloc_atomic(sizeof(*rx_param));
 	if (!bcn->rx_data) {
-		scm_debug_rl("Failed to allocate memory for rx_data");
 		status = QDF_STATUS_E_NOMEM;
 		goto free;
 	}