From 409d19924e86957235392374f82af5bf74b519f5 Mon Sep 17 00:00:00 2001 From: Madhvapathi Sriram Date: Mon, 7 Jan 2019 09:25:15 +0530 Subject: [PATCH] qcacmn: Remove error log for qdf_mem_malloc in os_if files qdf layer already has the error trace Change-Id: I4ff1fa2a7e261aecd715fd2c8ae68e6e843f1118 CRs-Fixed: 2376427 --- .../cp_stats/src/wlan_cfg80211_mc_cp_stats.c | 17 +++---------- os_if/linux/scan/src/wlan_cfg80211_scan.c | 25 ++++++------------- os_if/linux/wifi_pos/src/os_if_wifi_pos.c | 7 +++--- os_if/linux/wlan_osif_request_manager.c | 7 +++--- 4 files changed, 17 insertions(+), 39 deletions(-) diff --git a/os_if/linux/cp_stats/src/wlan_cfg80211_mc_cp_stats.c b/os_if/linux/cp_stats/src/wlan_cfg80211_mc_cp_stats.c index 1cb81898ea..3f18ed6872 100644 --- a/os_if/linux/cp_stats/src/wlan_cfg80211_mc_cp_stats.c +++ b/os_if/linux/cp_stats/src/wlan_cfg80211_mc_cp_stats.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011-2018 The Linux Foundation. All rights reserved. + * Copyright (c) 2011-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 @@ -326,10 +326,8 @@ static void get_peer_rssi_cb(struct stats_event *ev, void *cookie) } priv->peer_stats = qdf_mem_malloc(rssi_size); - if (!priv->peer_stats) { - cfg80211_err("allocation failed"); + if (!priv->peer_stats) goto get_peer_rssi_cb_fail; - } priv->num_peer_stats = ev->num_peer_stats; qdf_mem_copy(priv->peer_stats, ev->peer_stats, rssi_size); @@ -357,7 +355,6 @@ wlan_cfg80211_mc_cp_stats_get_peer_rssi(struct wlan_objmgr_vdev *vdev, out = qdf_mem_malloc(sizeof(*out)); if (!out) { - cfg80211_err("allocation failed"); *errno = -ENOMEM; return NULL; } @@ -440,16 +437,12 @@ static void get_station_stats_cb(struct stats_event *ev, void *cookie) } priv->vdev_summary_stats = qdf_mem_malloc(summary_size); - if (!priv->vdev_summary_stats) { - cfg80211_err("memory allocation failed"); + if (!priv->vdev_summary_stats) goto station_stats_cb_fail; - } priv->vdev_chain_rssi = qdf_mem_malloc(rssi_size); - if (!priv->vdev_chain_rssi) { - cfg80211_err("memory allocation failed"); + if (!priv->vdev_chain_rssi) goto station_stats_cb_fail; - } priv->num_summary_stats = ev->num_summary_stats; priv->num_chain_rssi_stats = ev->num_chain_rssi_stats; @@ -483,14 +476,12 @@ wlan_cfg80211_mc_cp_stats_get_station_stats(struct wlan_objmgr_vdev *vdev, out = qdf_mem_malloc(sizeof(*out)); if (!out) { - cfg80211_err("allocation failed"); *errno = -ENOMEM; return NULL; } request = osif_request_alloc(¶ms); if (!request) { - cfg80211_err("Request allocation failure, return cached value"); qdf_mem_free(out); *errno = -ENOMEM; return NULL; diff --git a/os_if/linux/scan/src/wlan_cfg80211_scan.c b/os_if/linux/scan/src/wlan_cfg80211_scan.c index f701218eb5..67c71581c0 100644 --- a/os_if/linux/scan/src/wlan_cfg80211_scan.c +++ b/os_if/linux/scan/src/wlan_cfg80211_scan.c @@ -418,10 +418,8 @@ int wlan_cfg80211_sched_scan_start(struct wlan_objmgr_vdev *vdev, } req = qdf_mem_malloc(sizeof(*req)); - if (!req) { - cfg80211_err("req malloc failed"); + if (!req) return -ENOMEM; - } wlan_pdev_obj_lock(pdev); psoc = wlan_pdev_get_psoc(pdev); @@ -669,10 +667,8 @@ static int wlan_scan_request_enqueue(struct wlan_objmgr_pdev *pdev, struct osif_scan_pdev *osif_scan; scan_req = qdf_mem_malloc(sizeof(*scan_req)); - if (!scan_req) { - cfg80211_alert("malloc failed for Scan req"); + if (!scan_req) return -ENOMEM; - } /* Get NL global context from objmgr*/ osif_ctx = wlan_pdev_get_ospriv(pdev); @@ -1090,10 +1086,9 @@ QDF_STATUS wlan_cfg80211_scan_priv_init(struct wlan_objmgr_pdev *pdev) osif_priv = wlan_pdev_get_ospriv(pdev); scan_priv = qdf_mem_malloc(sizeof(*scan_priv)); - if (!scan_priv) { - cfg80211_err("failed to allocate memory"); + if (!scan_priv) return QDF_STATUS_E_NOMEM; - } + /* Initialize the scan request queue */ osif_priv->osif_scan = scan_priv; scan_priv->req_id = req_id; @@ -1166,7 +1161,6 @@ wlan_cfg80211_enqueue_for_cleanup(qdf_list_t *scan_cleanup_q, scan_cleanup = qdf_mem_malloc(sizeof(struct scan_req)); if (!scan_cleanup) { qdf_mutex_release(&scan_priv->scan_req_q_lock); - cfg80211_err("Failed to allocate memory"); return; } scan_cleanup->scan_request = scan_req->scan_request; @@ -1325,10 +1319,9 @@ int wlan_cfg80211_scan(struct wlan_objmgr_vdev *vdev, } req = qdf_mem_malloc(sizeof(*req)); - if (!req) { - cfg80211_err("Failed to allocate scan request memory"); + if (!req) return -EINVAL; - } + /* Initialize the scan global params */ ucfg_scan_init_default_params(vdev, req); @@ -1500,7 +1493,6 @@ int wlan_cfg80211_scan(struct wlan_objmgr_vdev *vdev, if (request->ie_len) { req->scan_req.extraie.ptr = qdf_mem_malloc(request->ie_len); if (!req->scan_req.extraie.ptr) { - cfg80211_err("Failed to allocate memory"); ret = -ENOMEM; goto err; } @@ -1511,7 +1503,6 @@ int wlan_cfg80211_scan(struct wlan_objmgr_vdev *vdev, req->scan_req.extraie.ptr = qdf_mem_malloc(params->default_ie.len); if (!req->scan_req.extraie.ptr) { - cfg80211_err("Failed to allocate memory"); ret = -ENOMEM; goto err; } @@ -1641,10 +1632,8 @@ QDF_STATUS wlan_abort_scan(struct wlan_objmgr_pdev *pdev, struct wlan_objmgr_vdev *vdev; req = qdf_mem_malloc(sizeof(*req)); - if (!req) { - cfg80211_err("Failed to allocate memory"); + if (!req) return QDF_STATUS_E_NOMEM; - } /* Get NL global context from objmgr*/ osif_ctx = wlan_pdev_get_ospriv(pdev); diff --git a/os_if/linux/wifi_pos/src/os_if_wifi_pos.c b/os_if/linux/wifi_pos/src/os_if_wifi_pos.c index 17ea6744f1..fb4658a77a 100644 --- a/os_if/linux/wifi_pos/src/os_if_wifi_pos.c +++ b/os_if/linux/wifi_pos/src/os_if_wifi_pos.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 @@ -277,10 +277,9 @@ void os_if_wifi_pos_send_peer_status(struct qdf_mac_addr *peer_mac, } peer_info = qdf_mem_malloc(sizeof(*peer_info)); - if (!peer_info) { - cfg80211_alert("malloc failed"); + if (!peer_info) return; - } + qdf_mem_copy(peer_info->peer_mac_addr, peer_mac->bytes, sizeof(peer_mac->bytes)); peer_info->peer_status = peer_status; diff --git a/os_if/linux/wlan_osif_request_manager.c b/os_if/linux/wlan_osif_request_manager.c index 448b8532dc..08da108fc4 100644 --- a/os_if/linux/wlan_osif_request_manager.c +++ b/os_if/linux/wlan_osif_request_manager.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 @@ -89,10 +89,9 @@ struct osif_request *osif_request_alloc(const struct osif_request_params *params length = sizeof(*request) + params->priv_size; request = qdf_mem_malloc(length); - if (!request) { - cfg80211_err("allocation failed"); + if (!request) return NULL; - } + request->reference_count = 1; request->params = *params; qdf_event_create(&request->completed);