qcacmn: Remove error log for qdf_mem_malloc in umac files
qdf layer already has the error trace
Change-Id: I2ea22fe0e3e59b9d41ac21142615ffb96227abaf
CRs-Fixed: 2376418
diff --git a/umac/cmn_services/crypto/src/wlan_crypto_global_api.c b/umac/cmn_services/crypto/src/wlan_crypto_global_api.c
index 5833f83..8fbd62d 100644
--- a/umac/cmn_services/crypto/src/wlan_crypto_global_api.c
+++ b/umac/cmn_services/crypto/src/wlan_crypto_global_api.c
@@ -619,10 +619,8 @@
return QDF_STATUS_E_INVAL;
}
key = qdf_mem_malloc(sizeof(struct wlan_crypto_key));
- if (key == NULL) {
- crypto_err("igtk key alloc failed");
+ if (!key)
return QDF_STATUS_E_NOMEM;
- }
if (crypto_priv->igtk_key[igtk_idx])
qdf_mem_free(crypto_priv->igtk_key[igtk_idx]);
@@ -702,10 +700,9 @@
return QDF_STATUS_E_INVAL;
}
key = qdf_mem_malloc(sizeof(struct wlan_crypto_key));
- if (key == NULL) {
- crypto_err("igtk key alloc failed");
+ if (!key)
return QDF_STATUS_E_NOMEM;
- }
+
if (crypto_priv->igtk_key[igtk_idx])
qdf_mem_free(crypto_priv->igtk_key[igtk_idx]);
@@ -1783,10 +1780,9 @@
hdr = (struct wlan_frame_hdr *) bfrm;
buf = qdf_mem_malloc(len - hdrlen + 20);
- if (!buf) {
- crypto_err("malloc failed");
+ if (!buf)
return NULL;
- }
+
qdf_mem_zero(buf, len - hdrlen + 20);
aad = buf;
/* generate BIP AAD: FC(masked) || A1 || A2 || A3 */
@@ -1921,10 +1917,9 @@
}
buf = qdf_mem_malloc(len - hdrlen + 20);
- if (!buf) {
- crypto_err("malloc failed");
+ if (!buf)
return false;
- }
+
aad = buf;
/* construct AAD */
@@ -3142,10 +3137,9 @@
if (cipher_table->cipher == WLAN_CRYPTO_CIPHER_WEP) {
sta_key = qdf_mem_malloc(
sizeof(struct wlan_crypto_key));
- if (!sta_key) {
- crypto_err("key alloc failed");
+ if (!sta_key)
return QDF_STATUS_E_NOMEM;
- }
+
sta_crypto_priv->key[i] = sta_key;
qdf_mem_copy(sta_key, key,
sizeof(struct wlan_crypto_key));
diff --git a/umac/cmn_services/mgmt_txrx/core/src/wlan_mgmt_txrx_main.c b/umac/cmn_services/mgmt_txrx/core/src/wlan_mgmt_txrx_main.c
index d68763b..5fcff44 100644
--- a/umac/cmn_services/mgmt_txrx/core/src/wlan_mgmt_txrx_main.c
+++ b/umac/cmn_services/mgmt_txrx/core/src/wlan_mgmt_txrx_main.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016-2018 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2016-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
@@ -38,10 +38,9 @@
MGMT_DESC_POOL_MAX *
sizeof(struct mgmt_txrx_desc_elem_t));
- if (!mgmt_txrx_pdev_ctx->mgmt_desc_pool.pool) {
- mgmt_txrx_err("Failed to allocate desc pool");
+ if (!mgmt_txrx_pdev_ctx->mgmt_desc_pool.pool)
return QDF_STATUS_E_NOMEM;
- }
+
qdf_list_create(&mgmt_txrx_pdev_ctx->mgmt_desc_pool.free_list,
MGMT_DESC_POOL_MAX);
diff --git a/umac/cmn_services/mgmt_txrx/dispatcher/src/wlan_mgmt_txrx_utils_api.c b/umac/cmn_services/mgmt_txrx/dispatcher/src/wlan_mgmt_txrx_utils_api.c
index 683239b..4bc6836 100644
--- a/umac/cmn_services/mgmt_txrx/dispatcher/src/wlan_mgmt_txrx_utils_api.c
+++ b/umac/cmn_services/mgmt_txrx/dispatcher/src/wlan_mgmt_txrx_utils_api.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016-2018 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2016-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
@@ -58,7 +58,6 @@
mgmt_txrx_psoc_ctx = qdf_mem_malloc(sizeof(*mgmt_txrx_psoc_ctx));
if (!mgmt_txrx_psoc_ctx) {
- mgmt_txrx_err("Failed to allocate mgmt txrx context");
status = QDF_STATUS_E_NOMEM;
goto err_return;
}
@@ -162,7 +161,6 @@
mgmt_txrx_pdev_ctx = qdf_mem_malloc(sizeof(*mgmt_txrx_pdev_ctx));
if (!mgmt_txrx_pdev_ctx) {
- mgmt_txrx_err("Failed to allocate mgmt txrx context");
status = QDF_STATUS_E_NOMEM;
goto err_return;
}
@@ -179,8 +177,6 @@
mgmt_txrx_stats = qdf_mem_malloc(sizeof(*mgmt_txrx_stats));
if (!mgmt_txrx_stats) {
- mgmt_txrx_err(
- "Failed to allocate memory for mgmt txrx stats structure");
status = QDF_STATUS_E_NOMEM;
goto err_mgmt_txrx_stats;
}
@@ -535,10 +531,8 @@
struct mgmt_rx_handler *rx_handler;
rx_handler = qdf_mem_malloc(sizeof(*rx_handler));
- if (!rx_handler) {
- mgmt_txrx_err("Couldn't allocate memory for rx handler");
+ if (!rx_handler)
return QDF_STATUS_E_NOMEM;
- }
rx_handler->comp_id = comp_id;
rx_handler->rx_cb = mgmt_rx_cb;
diff --git a/umac/cmn_services/obj_mgr/src/wlan_objmgr_debug.c b/umac/cmn_services/obj_mgr/src/wlan_objmgr_debug.c
index c9aa2b7..cc43f04 100644
--- a/umac/cmn_services/obj_mgr/src/wlan_objmgr_debug.c
+++ b/umac/cmn_services/obj_mgr/src/wlan_objmgr_debug.c
@@ -1,6 +1,6 @@
/*
*
- * Copyright (c) 2018 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2018-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
@@ -154,10 +154,9 @@
tstamp = qdf_system_ticks_to_msecs(qdf_system_ticks()) / 1000;
node = qdf_mem_malloc(sizeof(*node));
- if (!node) {
- obj_mgr_err("Object node creation failed");
+ if (!node)
return;
- }
+
node->obj = obj;
node->obj_type = obj_type;
node->tstamp = tstamp;
@@ -363,7 +362,6 @@
debug_info = qdf_mem_malloc(sizeof(*debug_info));
if (!debug_info) {
- obj_mgr_err("debug_info allocation failed");
g_umac_glb_obj->debug_info = NULL;
return;
}
diff --git a/umac/cmn_services/obj_mgr/src/wlan_objmgr_global_obj.c b/umac/cmn_services/obj_mgr/src/wlan_objmgr_global_obj.c
index 065cb19..6fea3c0 100644
--- a/umac/cmn_services/obj_mgr/src/wlan_objmgr_global_obj.c
+++ b/umac/cmn_services/obj_mgr/src/wlan_objmgr_global_obj.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016-2018 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2016-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
@@ -44,10 +44,9 @@
/* Allocation of memory for Global object */
umac_global_obj = (struct wlan_objmgr_global *)qdf_mem_malloc(
sizeof(*umac_global_obj));
- if (umac_global_obj == NULL) {
- obj_mgr_err("Global object alloc failed due to malloc");
+ if (!umac_global_obj)
return QDF_STATUS_E_NOMEM;
- }
+
/* Store Global object pointer in Global variable */
g_umac_glb_obj = umac_global_obj;
/* Initialize spinlock */
diff --git a/umac/cmn_services/obj_mgr/src/wlan_objmgr_pdev_obj.c b/umac/cmn_services/obj_mgr/src/wlan_objmgr_pdev_obj.c
index 8884b38..53bf3a1 100644
--- a/umac/cmn_services/obj_mgr/src/wlan_objmgr_pdev_obj.c
+++ b/umac/cmn_services/obj_mgr/src/wlan_objmgr_pdev_obj.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016-2018 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2016-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
@@ -107,10 +107,9 @@
}
/* Allocate PDEV object's memory */
pdev = qdf_mem_malloc(sizeof(*pdev));
- if (pdev == NULL) {
- obj_mgr_err("pdev alloc failed");
+ if (!pdev)
return NULL;
- }
+
pdev->obj_state = WLAN_OBJ_STATE_ALLOCATED;
/* Initialize PDEV spinlock */
qdf_spinlock_create(&pdev->pdev_lock);
diff --git a/umac/cmn_services/obj_mgr/src/wlan_objmgr_peer_obj.c b/umac/cmn_services/obj_mgr/src/wlan_objmgr_peer_obj.c
index 49d8dae..d291337 100644
--- a/umac/cmn_services/obj_mgr/src/wlan_objmgr_peer_obj.c
+++ b/umac/cmn_services/obj_mgr/src/wlan_objmgr_peer_obj.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016-2018 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2016-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
@@ -177,13 +177,9 @@
}
/* Allocate memory for peer object */
peer = qdf_mem_malloc(sizeof(*peer));
- if (peer == NULL) {
- obj_mgr_err(
- "Peer(%02x:%02x:%02x:%02x:%02x:%02x) allocation failure",
- macaddr[0], macaddr[1], macaddr[2],
- macaddr[3], macaddr[4], macaddr[5]);
+ if (!peer)
return NULL;
- }
+
peer->obj_state = WLAN_OBJ_STATE_ALLOCATED;
qdf_atomic_init(&peer->peer_objmgr.ref_cnt);
wlan_objmgr_peer_init_ref_id_debug(peer);
diff --git a/umac/cmn_services/obj_mgr/src/wlan_objmgr_psoc_obj.c b/umac/cmn_services/obj_mgr/src/wlan_objmgr_psoc_obj.c
index 44344af..15067ea 100644
--- a/umac/cmn_services/obj_mgr/src/wlan_objmgr_psoc_obj.c
+++ b/umac/cmn_services/obj_mgr/src/wlan_objmgr_psoc_obj.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016-2018 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2016-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
@@ -119,10 +119,9 @@
void *arg;
psoc = qdf_mem_malloc(sizeof(*psoc));
- if (psoc == NULL) {
- obj_mgr_err("PSOC allocation failed");
+ if (!psoc)
return NULL;
- }
+
psoc->obj_state = WLAN_OBJ_STATE_ALLOCATED;
qdf_spinlock_create(&psoc->psoc_lock);
/* Initialize with default values */
@@ -1297,10 +1296,8 @@
bool lock_released = false;
logical_del_peer_list = qdf_mem_malloc(sizeof(*logical_del_peer_list));
- if (!logical_del_peer_list) {
- obj_mgr_err("failed to allocate list");
+ if (!logical_del_peer_list)
return NULL;
- }
qdf_list_create(logical_del_peer_list, WLAN_UMAC_PSOC_MAX_PEERS);
@@ -1337,7 +1334,6 @@
if (peer_list == NULL) {
wlan_objmgr_peer_release_ref(peer, dbg_id);
/* Lock is already released */
- obj_mgr_alert("Mem alloc failed");
WLAN_OBJMGR_BUG(0);
break;
}
diff --git a/umac/cmn_services/obj_mgr/src/wlan_objmgr_vdev_obj.c b/umac/cmn_services/obj_mgr/src/wlan_objmgr_vdev_obj.c
index 63d3200..3ba3a93 100644
--- a/umac/cmn_services/obj_mgr/src/wlan_objmgr_vdev_obj.c
+++ b/umac/cmn_services/obj_mgr/src/wlan_objmgr_vdev_obj.c
@@ -138,10 +138,9 @@
}
/* Allocate vdev object memory */
vdev = qdf_mem_malloc(sizeof(*vdev));
- if (vdev == NULL) {
- obj_mgr_err("Memory allocation failure");
+ if (!vdev)
return NULL;
- }
+
vdev->obj_state = WLAN_OBJ_STATE_ALLOCATED;
vdev->vdev_mlme.bss_chan = qdf_mem_malloc(sizeof(struct wlan_channel));
diff --git a/umac/cmn_services/serialization/src/wlan_serialization_main.c b/umac/cmn_services/serialization/src/wlan_serialization_main.c
index 36f6b07..dbb7fb3 100644
--- a/umac/cmn_services/serialization/src/wlan_serialization_main.c
+++ b/umac/cmn_services/serialization/src/wlan_serialization_main.c
@@ -22,7 +22,6 @@
* serialization to initialize and de-initialize the
* component.
*/
-
#include <qdf_status.h>
#include <qdf_list.h>
#include <wlan_objmgr_cmn.h>
@@ -78,7 +77,6 @@
qdf_mem_malloc(sizeof(struct wlan_serialization_timer) *
ser_soc_obj->max_active_cmds);
if (!ser_soc_obj->timers) {
- ser_alert("Mem alloc failed for ser timers");
status = QDF_STATUS_E_NOMEM;
goto error;
}
@@ -110,10 +108,9 @@
soc_ser_obj =
qdf_mem_malloc(sizeof(*soc_ser_obj));
- if (!soc_ser_obj) {
- ser_alert("Mem alloc failed for ser psoc priv obj");
+ if (!soc_ser_obj)
goto error;
- }
+
status = wlan_objmgr_psoc_component_obj_attach(
psoc,
WLAN_UMAC_COMP_SERIALIZATION,
@@ -185,7 +182,6 @@
for (i = 0; i < cmd_pool_size; i++) {
cmd_list_ptr = qdf_mem_malloc(sizeof(*cmd_list_ptr));
if (!cmd_list_ptr) {
- ser_alert("Mem alloc failed for cmd node");
wlan_serialization_destroy_cmd_pool(pdev_queue);
goto error;
}
@@ -231,10 +227,8 @@
ser_pdev_obj =
qdf_mem_malloc(sizeof(*ser_pdev_obj));
- if (!ser_pdev_obj) {
- ser_alert("Mem alloc failed for ser pdev obj");
+ if (!ser_pdev_obj)
goto error;
- }
for (index = 0; index < SER_PDEV_QUEUE_COMP_MAX; index++) {
pdev_queue = &ser_pdev_obj->pdev_q[index];
@@ -396,10 +390,8 @@
uint8_t max_pending_cmds;
ser_vdev_obj = qdf_mem_malloc(sizeof(*ser_vdev_obj));
- if (!ser_vdev_obj) {
- ser_alert("Mem alloc failed for ser vdev obj");
+ if (!ser_vdev_obj)
goto error;
- }
for (index = 0; index < SER_VDEV_QUEUE_COMP_MAX; index++) {
vdev_q = &ser_vdev_obj->vdev_q[index];
diff --git a/umac/cmn_services/sm_engine/src/wlan_sm_engine.c b/umac/cmn_services/sm_engine/src/wlan_sm_engine.c
index 26e22f1..6b6e6fb 100644
--- a/umac/cmn_services/sm_engine/src/wlan_sm_engine.c
+++ b/umac/cmn_services/sm_engine/src/wlan_sm_engine.c
@@ -257,10 +257,8 @@
}
sm = qdf_mem_malloc(sizeof(*sm));
- if (!sm) {
- sm_engine_alert("%s: sm allocation failed", name);
+ if (!sm)
return NULL;
- }
wlan_sm_history_init(sm);
diff --git a/umac/cp_stats/core/src/wlan_cp_stats_obj_mgr_handler.c b/umac/cp_stats/core/src/wlan_cp_stats_obj_mgr_handler.c
index 11f9460..50e442f 100644
--- a/umac/cp_stats/core/src/wlan_cp_stats_obj_mgr_handler.c
+++ b/umac/cp_stats/core/src/wlan_cp_stats_obj_mgr_handler.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2018-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
@@ -46,7 +46,6 @@
csc = qdf_mem_malloc(sizeof(*csc));
if (!csc) {
- cp_stats_err("Failed to allocate cp_stats_context object");
status = QDF_STATUS_E_NOMEM;
goto wlan_cp_stats_psoc_obj_create_handler_return;
}
@@ -72,7 +71,6 @@
psoc_cs = qdf_mem_malloc(sizeof(*psoc_cs));
if (!psoc_cs) {
- cp_stats_err("Failed to allocate psoc_cp_stats object");
status = QDF_STATUS_E_NOMEM;
goto wlan_cp_stats_psoc_obj_create_handler_return;
}
@@ -160,7 +158,6 @@
pdev_cs = qdf_mem_malloc(sizeof(*pdev_cs));
if (!pdev_cs) {
- cp_stats_err("Failed to allocate pdev_cp_stats object");
status = QDF_STATUS_E_NOMEM;
goto wlan_cp_stats_pdev_obj_create_handler_return;
}
@@ -248,7 +245,6 @@
vdev_cs = qdf_mem_malloc(sizeof(*vdev_cs));
if (!vdev_cs) {
- cp_stats_err("Failed to allocate vdev_cp_stats object");
status = QDF_STATUS_E_NOMEM;
goto wlan_cp_stats_vdev_obj_create_handler_return;
}
@@ -336,7 +332,6 @@
peer_cs = qdf_mem_malloc(sizeof(*peer_cs));
if (!peer_cs) {
- cp_stats_err("Failed to allocate peer_cp_stats object");
status = QDF_STATUS_E_NOMEM;
goto wlan_cp_stats_peer_obj_create_handler_return;
}
diff --git a/umac/cp_stats/dispatcher/src/wlan_cp_stats_mc_tgt_api.c b/umac/cp_stats/dispatcher/src/wlan_cp_stats_mc_tgt_api.c
index 8ab809a..5198424 100644
--- a/umac/cp_stats/dispatcher/src/wlan_cp_stats_mc_tgt_api.c
+++ b/umac/cp_stats/dispatcher/src/wlan_cp_stats_mc_tgt_api.c
@@ -169,10 +169,8 @@
peer_count = wlan_pdev_get_peer_count(pdev);
ev.peer_stats = qdf_mem_malloc(sizeof(*ev.peer_stats) *
peer_count);
- if (!ev.peer_stats) {
- cp_stats_err("malloc failed");
+ if (!ev.peer_stats)
goto end;
- }
wlan_objmgr_pdev_iterate_obj_list(pdev, WLAN_PEER_OP,
peer_rssi_iterator, &ev,
@@ -192,10 +190,8 @@
}
ev.peer_stats = qdf_mem_malloc(sizeof(*ev.peer_stats));
- if (!ev.peer_stats) {
- cp_stats_err("malloc failed");
+ if (!ev.peer_stats)
goto end;
- }
ev.num_peer_stats = 1;
wlan_cp_stats_peer_obj_lock(peer_cp_stats_priv);
diff --git a/umac/cp_stats/dispatcher/src/wlan_cp_stats_mc_ucfg_api.c b/umac/cp_stats/dispatcher/src/wlan_cp_stats_mc_ucfg_api.c
index daad590..7a77704 100644
--- a/umac/cp_stats/dispatcher/src/wlan_cp_stats_mc_ucfg_api.c
+++ b/umac/cp_stats/dispatcher/src/wlan_cp_stats_mc_ucfg_api.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2018-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
@@ -34,10 +34,8 @@
QDF_STATUS wlan_cp_stats_psoc_cs_init(struct psoc_cp_stats *psoc_cs)
{
psoc_cs->obj_stats = qdf_mem_malloc(sizeof(struct psoc_mc_cp_stats));
- if (!psoc_cs->obj_stats) {
- cp_stats_err("malloc failed");
+ if (!psoc_cs->obj_stats)
return QDF_STATUS_E_NOMEM;
- }
return QDF_STATUS_SUCCESS;
}
@@ -52,10 +50,9 @@
QDF_STATUS wlan_cp_stats_vdev_cs_init(struct vdev_cp_stats *vdev_cs)
{
vdev_cs->vdev_stats = qdf_mem_malloc(sizeof(struct vdev_mc_cp_stats));
- if (!vdev_cs->vdev_stats) {
- cp_stats_err("malloc failed");
+ if (!vdev_cs->vdev_stats)
return QDF_STATUS_E_NOMEM;
- }
+
return QDF_STATUS_SUCCESS;
}
@@ -69,10 +66,9 @@
QDF_STATUS wlan_cp_stats_pdev_cs_init(struct pdev_cp_stats *pdev_cs)
{
pdev_cs->pdev_stats = qdf_mem_malloc(sizeof(struct pdev_mc_cp_stats));
- if (!pdev_cs->pdev_stats) {
- cp_stats_err("malloc failed");
+ if (!pdev_cs->pdev_stats)
return QDF_STATUS_E_NOMEM;
- }
+
return QDF_STATUS_SUCCESS;
}
@@ -86,10 +82,9 @@
QDF_STATUS wlan_cp_stats_peer_cs_init(struct peer_cp_stats *peer_cs)
{
peer_cs->peer_stats = qdf_mem_malloc(sizeof(struct peer_mc_cp_stats));
- if (!peer_cs->peer_stats) {
- cp_stats_err("malloc failed");
+ if (!peer_cs->peer_stats)
return QDF_STATUS_E_NOMEM;
- }
+
return QDF_STATUS_SUCCESS;
}
diff --git a/umac/dfs/core/src/filtering/dfs_init.c b/umac/dfs/core/src/filtering/dfs_init.c
index 1f44380..3f90261 100644
--- a/umac/dfs/core/src/filtering/dfs_init.c
+++ b/umac/dfs/core/src/filtering/dfs_init.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, 2016-2018 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2013, 2016-2019 The Linux Foundation. All rights reserved.
* Copyright (c) 2002-2010, Atheros Communications Inc.
*
* Permission to use, copy, modify, and/or distribute this software for any
@@ -355,11 +355,8 @@
* Malloc can return NULL if numb5radars is zero. But we still
* want to reset the delay lines.
*/
- if (!(dfs->dfs_b5radars)) {
- dfs_alert(dfs, WLAN_DEBUG_DFS_ALWAYS,
- "cannot allocate memory for bin5 radars");
+ if (!(dfs->dfs_b5radars))
goto bad4;
- }
}
for (n = 0; n < numb5radars; n++) {
diff --git a/umac/dfs/core/src/filtering/dfs_process_radarevent.c b/umac/dfs/core/src/filtering/dfs_process_radarevent.c
index fb2bfb3..80ad265 100644
--- a/umac/dfs/core/src/filtering/dfs_process_radarevent.c
+++ b/umac/dfs/core/src/filtering/dfs_process_radarevent.c
@@ -1291,11 +1291,8 @@
struct radar_found_info *radar_found;
radar_found = qdf_mem_malloc(sizeof(*radar_found));
- if (!radar_found) {
- dfs_alert(dfs, WLAN_DEBUG_DFS_ALWAYS,
- "radar_found allocation failed");
+ if (!radar_found)
return;
- }
qdf_mem_zero(radar_found, sizeof(*radar_found));
radar_found->segment_id = seg_id;
diff --git a/umac/dfs/core/src/misc/dfs.c b/umac/dfs/core/src/misc/dfs.c
index 62b6e90..24094d9 100644
--- a/umac/dfs/core/src/misc/dfs.c
+++ b/umac/dfs/core/src/misc/dfs.c
@@ -151,19 +151,14 @@
int dfs_create_object(struct wlan_dfs **dfs)
{
*dfs = dfs_alloc_wlan_dfs();
- if (!(*dfs)) {
- dfs_alert(NULL, WLAN_DEBUG_DFS_ALWAYS,
- "wlan_dfs allocation failed");
+ if (!(*dfs))
return 1;
- }
qdf_mem_zero(*dfs, sizeof(**dfs));
(*dfs)->dfs_curchan = dfs_alloc_dfs_curchan();
if (!((*dfs)->dfs_curchan)) {
dfs_free_wlan_dfs(*dfs);
- dfs_alert(*dfs, WLAN_DEBUG_DFS_ALWAYS,
- "dfs_curchan allocation failed");
return 1;
}
diff --git a/umac/dfs/core/src/misc/dfs_filter_init.c b/umac/dfs/core/src/misc/dfs_filter_init.c
index 33b579d..58c401a 100644
--- a/umac/dfs/core/src/misc/dfs_filter_init.c
+++ b/umac/dfs/core/src/misc/dfs_filter_init.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016-2018 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2016-2019 The Linux Foundation. All rights reserved.
* Copyright (c) 2002-2006, Atheros Communications Inc.
*
* Permission to use, copy, modify, and/or distribute this software for any
@@ -229,11 +229,8 @@
WLAN_DFS_DATA_STRUCT_LOCK_CREATE(dfs);
dfs->events = dfs_alloc_dfs_events();
- if (!(dfs->events)) {
- dfs_alert(dfs, WLAN_DEBUG_DFS_ALWAYS,
- "events allocation failed");
+ if (!(dfs->events))
return 1;
- }
for (i = 0; i < DFS_MAX_EVENTS; i++)
STAILQ_INSERT_TAIL(&(dfs->dfs_eventq), &dfs->events[i],
@@ -243,8 +240,6 @@
if (!(dfs->pulses)) {
dfs_free_dfs_events(dfs->events);
dfs->events = NULL;
- dfs_alert(dfs, WLAN_DEBUG_DFS_ALWAYS,
- "Pulse buffer allocation failed");
return 1;
}
@@ -254,11 +249,9 @@
for (n = 0; n < DFS_MAX_RADAR_TYPES; n++) {
dfs->dfs_radarf[n] = (struct dfs_filtertype *)
qdf_mem_malloc(sizeof(struct dfs_filtertype));
- if (!(dfs->dfs_radarf[n])) {
- dfs_alert(dfs, WLAN_DEBUG_DFS_ALWAYS,
- "cannot allocate memory for radar filter types");
+ if (!(dfs->dfs_radarf[n]))
goto bad1;
- }
+
qdf_mem_zero(dfs->dfs_radarf[n],
sizeof(struct dfs_filtertype));
status = dfs_alloc_mem_filter(dfs->dfs_radarf[n]);
@@ -272,18 +265,14 @@
/* Allocate memory for radar table. */
dfs->dfs_ftindextable = (int8_t **)qdf_mem_malloc(
DFS_NUM_FT_IDX_TBL_ROWS*sizeof(int8_t *));
- if (!(dfs->dfs_ftindextable)) {
- dfs_alert(dfs, WLAN_DEBUG_DFS_ALWAYS, "Cannot allocate memory for radar table");
+ if (!(dfs->dfs_ftindextable))
goto bad1;
- }
+
for (n = 0; n < DFS_NUM_FT_IDX_TBL_ROWS; n++) {
dfs->dfs_ftindextable[n] = qdf_mem_malloc(
DFS_MAX_RADAR_OVERLAP*sizeof(int8_t));
- if (!(dfs->dfs_ftindextable[n])) {
- dfs_alert(dfs, WLAN_DEBUG_DFS_ALWAYS,
- "cannot allocate memory for radar table entry");
+ if (!(dfs->dfs_ftindextable[n]))
goto bad2;
- }
}
dfs->dfs_use_nol = 1;
diff --git a/umac/dfs/core/src/misc/dfs_nol.c b/umac/dfs/core/src/misc/dfs_nol.c
index 92bc243..c0d432c 100644
--- a/umac/dfs/core/src/misc/dfs_nol.c
+++ b/umac/dfs/core/src/misc/dfs_nol.c
@@ -487,16 +487,14 @@
dfs_nol = (struct dfsreq_nolelem *)qdf_mem_malloc(
sizeof(struct dfsreq_nolelem) * dfs->dfs_nol_count);
- if (!dfs_nol) {
- /*
- * XXX TODO: if this fails, just schedule a task to retry
- * updating the NOL at a later stage. That way the NOL
- * update _DOES_ happen - hopefully the failure was just
- * temporary.
- */
- dfs_alert(dfs, WLAN_DEBUG_DFS_ALWAYS, "failed to allocate NOL update memory!");
+ /*
+ * XXX TODO: if this fails, just schedule a task to retry
+ * updating the NOL at a later stage. That way the NOL
+ * update _DOES_ happen - hopefully the failure was just
+ * temporary.
+ */
+ if (!dfs_nol)
return;
- }
DFS_GET_NOL_LOCKED(dfs, dfs_nol, &nlen);
diff --git a/umac/dfs/core/src/misc/dfs_random_chan_sel.c b/umac/dfs/core/src/misc/dfs_random_chan_sel.c
index 9eb6b56..cf095a0 100644
--- a/umac/dfs/core/src/misc/dfs_random_chan_sel.c
+++ b/umac/dfs/core/src/misc/dfs_random_chan_sel.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012-2018 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2012-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
@@ -1403,11 +1403,8 @@
}
random_chan_list = qdf_mem_malloc(ch_cnt * sizeof(*random_chan_list));
- if (!random_chan_list) {
- dfs_alert(dfs, WLAN_DEBUG_DFS_RANDOM_CHAN,
- "Memory allocation failed");
+ if (!random_chan_list)
return 0;
- }
if (flags & DFS_RANDOM_CH_FLAG_NO_CURR_OPE_CH)
dfs_remove_cur_ch_from_list(ch_list, &ch_cnt, ch_wd, cur_chan);
@@ -1421,8 +1418,6 @@
/* list adjusted after leakage has been marked */
leakage_adjusted_lst = qdf_mem_malloc(random_chan_cnt);
if (!leakage_adjusted_lst) {
- dfs_alert(dfs, WLAN_DEBUG_DFS_RANDOM_CHAN,
- "Memory allocation failed");
qdf_mem_free(random_chan_list);
return 0;
}
diff --git a/umac/dfs/dispatcher/src/wlan_dfs_init_deinit_api.c b/umac/dfs/dispatcher/src/wlan_dfs_init_deinit_api.c
index dd6ec4f..07a055b 100644
--- a/umac/dfs/dispatcher/src/wlan_dfs_init_deinit_api.c
+++ b/umac/dfs/dispatcher/src/wlan_dfs_init_deinit_api.c
@@ -141,11 +141,8 @@
struct dfs_soc_priv_obj *dfs_soc_obj;
dfs_soc_obj = qdf_mem_malloc(sizeof(*dfs_soc_obj));
- if (!dfs_soc_obj) {
- dfs_err(NULL, WLAN_DEBUG_DFS_ALWAYS,
- "Failed to allocate memory for dfs object");
+ if (!dfs_soc_obj)
return QDF_STATUS_E_NOMEM;
- }
dfs_soc_obj->psoc = psoc;
diff --git a/umac/dfs/dispatcher/src/wlan_dfs_utils_api.c b/umac/dfs/dispatcher/src/wlan_dfs_utils_api.c
index 023dae8..5f4aaa5 100644
--- a/umac/dfs/dispatcher/src/wlan_dfs_utils_api.c
+++ b/umac/dfs/dispatcher/src/wlan_dfs_utils_api.c
@@ -609,7 +609,6 @@
cur_chan_list = qdf_mem_malloc(NUM_CHANNELS *
sizeof(struct regulatory_channel));
if (!cur_chan_list) {
- dfs_alert(dfs, WLAN_DEBUG_DFS_ALWAYS, "fail to alloc");
*num_chan = 0;
return;
}
@@ -677,10 +676,8 @@
}
tmp_chan_list = qdf_mem_malloc(*num_chan * sizeof(*tmp_chan_list));
- if (!tmp_chan_list) {
- dfs_alert(dfs, WLAN_DEBUG_DFS_ALWAYS, "mem alloc failed");
+ if (!tmp_chan_list)
return;
- }
utils_dfs_get_chan_list(pdev, (void *)tmp_chan_list, num_chan);
@@ -815,10 +812,8 @@
wlan_reg_get_dfs_region(pdev, &dfs_reg);
chan_list = qdf_mem_malloc(num_chan * sizeof(*chan_list));
- if (!chan_list) {
- dfs_alert(dfs, WLAN_DEBUG_DFS_ALWAYS, "mem alloc failed");
+ if (!chan_list)
goto random_chan_error;
- }
utils_dfs_get_channel_list(pdev, chan_list, &num_chan);
if (!num_chan) {
@@ -933,10 +928,8 @@
}
dfs_nolinfo = qdf_mem_malloc(sizeof(*dfs_nolinfo));
- if (!dfs_nolinfo) {
- dfs_err(dfs, WLAN_DEBUG_DFS_ALWAYS, "dfs_nolinfo alloc fail");
+ if (!dfs_nolinfo)
return;
- }
qdf_mem_zero(dfs_nolinfo, sizeof(*dfs_nolinfo));
len = pld_wlan_get_dfs_nol(qdf_dev->dev, (void *)dfs_nolinfo,
@@ -985,10 +978,8 @@
}
dfs_nolinfo = qdf_mem_malloc(sizeof(*dfs_nolinfo));
- if (!dfs_nolinfo) {
- dfs_err(dfs, WLAN_DEBUG_DFS_ALWAYS, "dfs_nolinfo alloc fail");
+ if (!dfs_nolinfo)
return;
- }
qdf_mem_zero(dfs_nolinfo, sizeof(*dfs_nolinfo));
DFS_GET_NOL_LOCKED(dfs, dfs_nolinfo->dfs_nol, &num_chans);
diff --git a/umac/green_ap/dispatcher/src/wlan_green_ap_api.c b/umac/green_ap/dispatcher/src/wlan_green_ap_api.c
index 8bf6255..e8cb236 100644
--- a/umac/green_ap/dispatcher/src/wlan_green_ap_api.c
+++ b/umac/green_ap/dispatcher/src/wlan_green_ap_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
@@ -75,10 +75,8 @@
}
green_ap_ctx = qdf_mem_malloc(sizeof(*green_ap_ctx));
- if (!green_ap_ctx) {
- green_ap_err("Memory allocation for Green AP context failed!");
+ if (!green_ap_ctx)
return QDF_STATUS_E_NOMEM;
- }
green_ap_ctx->ps_state = WLAN_GREEN_AP_PS_IDLE_STATE;
green_ap_ctx->ps_event = WLAN_GREEN_AP_PS_WAIT_EVENT;
diff --git a/umac/mlme/mlme_objmgr/dispatcher/src/wlan_vdev_mlme_main.c b/umac/mlme/mlme_objmgr/dispatcher/src/wlan_vdev_mlme_main.c
index 4857f15..06a4e70 100644
--- a/umac/mlme/mlme_objmgr/dispatcher/src/wlan_vdev_mlme_main.c
+++ b/umac/mlme/mlme_objmgr/dispatcher/src/wlan_vdev_mlme_main.c
@@ -56,10 +56,8 @@
}
vdev_mlme = qdf_mem_malloc(sizeof(*vdev_mlme));
- if (!vdev_mlme) {
- mlme_err(" MLME component object alloc failed");
+ if (!vdev_mlme)
return QDF_STATUS_E_NOMEM;
- }
vdev_mlme->vdev = vdev;
diff --git a/umac/scan/dispatcher/src/wlan_scan_utils_api.c b/umac/scan/dispatcher/src/wlan_scan_utils_api.c
index 7675139..28a3af7 100644
--- a/umac/scan/dispatcher/src/wlan_scan_utils_api.c
+++ b/umac/scan/dispatcher/src/wlan_scan_utils_api.c
@@ -939,10 +939,9 @@
* after ssid ie.
*/
tmp = qdf_mem_malloc(tmplen * sizeof(u_int8_t));
- if (!tmp) {
- scm_debug("tmp memory alloc failed");
+ if (!tmp)
return QDF_STATUS_E_NOMEM;
- }
+
/* Copy beacon data after ssid ie to tmp */
qdf_nbuf_copy_bits(bcnbuf, (sizeof(*hdr) +
ssid_ie_end_offset), tmplen, tmp);
@@ -1301,10 +1300,8 @@
pos = ie;
new_ie = qdf_mem_malloc(MAX_IE_LEN);
- if (!new_ie) {
- scm_err("Failed to allocate memory for new ie");
+ if (!new_ie)
return QDF_STATUS_E_NOMEM;
- }
while (pos < ie + ielen + 2) {
tmp = util_scan_find_ie(WLAN_ELEMID_MULTIPLE_BSSID, pos,
@@ -1356,7 +1353,6 @@
new_frame = qdf_mem_malloc(new_frame_len);
if (!new_frame) {
qdf_mem_free(new_ie);
- scm_err("failed to allocate memory");
return QDF_STATUS_E_NOMEM;
}
diff --git a/umac/wifi_pos/src/wifi_pos_main.c b/umac/wifi_pos/src/wifi_pos_main.c
index 4bdad7e..9fa45ac 100644
--- a/umac/wifi_pos/src/wifi_pos_main.c
+++ b/umac/wifi_pos/src/wifi_pos_main.c
@@ -319,7 +319,6 @@
num_valid_channels;
buf = qdf_mem_malloc(len);
if (!buf) {
- wifi_pos_alert("malloc failed");
wlan_objmgr_pdev_release_ref(pdev, WLAN_WIFI_POS_CORE_ID);
return QDF_STATUS_E_NOMEM;
}
@@ -416,7 +415,6 @@
+ sizeof(uint8_t);
app_reg_rsp = qdf_mem_malloc(rsp_len);
if (!app_reg_rsp) {
- wifi_pos_alert("malloc failed");
ret = QDF_STATUS_E_NOMEM;
err = OEM_ERR_NULL_CONTEXT;
goto app_reg_failed;
@@ -505,7 +503,6 @@
/* initialize wifi-pos psoc priv object */
wifi_pos_obj = qdf_mem_malloc(sizeof(*wifi_pos_obj));
if (!wifi_pos_obj) {
- wifi_pos_alert("Mem alloc failed for wifi pos psoc priv obj");
wifi_pos_clear_psoc();
return QDF_STATUS_E_NOMEM;
}
@@ -613,10 +610,9 @@
if (oem_rsp->rsp_len_2 + oem_rsp->dma_len) {
/* stitch togther the msg data_1 + CIR/CFR + data_2 */
data = qdf_mem_malloc(len);
- if (!data) {
- wifi_pos_err("malloc failed");
+ if (!data)
return -ENOMEM;
- }
+
qdf_mem_copy(data, oem_rsp->data_1, oem_rsp->rsp_len_1);
qdf_mem_copy(&data[oem_rsp->rsp_len_1],
oem_rsp->vaddr, oem_rsp->dma_len);