diff --git a/qdf/linux/src/qdf_crypto.c b/qdf/linux/src/qdf_crypto.c index c0e6234342..c8b080347f 100644 --- a/qdf/linux/src/qdf_crypto.c +++ b/qdf/linux/src/qdf_crypto.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 @@ -395,8 +395,6 @@ int qdf_crypto_aes_gmac(uint8_t *key, uint16_t key_length, IEEE80211_MMIE_GMAC_MICLEN + AAD_LEN; req = qdf_mem_malloc(req_size); if (!req) { - QDF_TRACE(QDF_MODULE_ID_QDF, QDF_TRACE_LEVEL_ERROR, - "Memory allocation failed"); ret = -ENOMEM; goto err_tfm; } diff --git a/qdf/linux/src/qdf_event.c b/qdf/linux/src/qdf_event.c index a4494b36a5..2ae9fba7aa 100644 --- a/qdf/linux/src/qdf_event.c +++ b/qdf/linux/src/qdf_event.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2018 The Linux Foundation. All rights reserved. + * Copyright (c) 2014-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 @@ -298,10 +298,8 @@ QDF_STATUS qdf_wait_for_event_completion(qdf_event_t *event, uint32_t timeout) return QDF_STATUS_E_INVAL; event_node = qdf_mem_malloc(sizeof(*event_node)); - if (!event_node) { - qdf_err("Out of memory"); + if (!event_node) return QDF_STATUS_E_NOMEM; - } event_node->pevent = event; diff --git a/qdf/linux/src/qdf_file.c b/qdf/linux/src/qdf_file.c index 340afd0a02..23935dbd53 100644 --- a/qdf/linux/src/qdf_file.c +++ b/qdf/linux/src/qdf_file.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 @@ -41,7 +41,6 @@ QDF_STATUS qdf_file_read(const char *path, char **out_buf) /* qdf_mem_malloc zeros new memory; +1 size ensures null-termination */ buf = qdf_mem_malloc(fw->size + 1); if (!buf) { - qdf_err("Failed to allocate file buffer of %zuB", fw->size + 1); release_firmware(fw); return QDF_STATUS_E_NOMEM; } diff --git a/qdf/linux/src/qdf_lro.c b/qdf/linux/src/qdf_lro.c index 0745daadba..0d83db8d39 100644 --- a/qdf/linux/src/qdf_lro.c +++ b/qdf/linux/src/qdf_lro.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015-2017 The Linux Foundation. All rights reserved. + * Copyright (c) 2015-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 @@ -133,11 +133,8 @@ qdf_lro_ctx_t qdf_lro_init(void) lro_mem_ptr = qdf_mem_malloc(lro_info_sz + lro_mgr_sz + desc_arr_sz + desc_pool_sz + hash_table_sz); - if (unlikely(!lro_mem_ptr)) { - QDF_TRACE(QDF_MODULE_ID_QDF, QDF_TRACE_LEVEL_ERROR, - "Unable to allocate memory for LRO"); + if (unlikely(!lro_mem_ptr)) return NULL; - } lro_ctx = (struct qdf_lro_s *)lro_mem_ptr; lro_mem_ptr += lro_info_sz; diff --git a/qdf/linux/src/qdf_mc_timer.c b/qdf/linux/src/qdf_mc_timer.c index 6726f321f4..6711c06fa2 100644 --- a/qdf/linux/src/qdf_mc_timer.c +++ b/qdf/linux/src/qdf_mc_timer.c @@ -366,10 +366,7 @@ QDF_STATUS qdf_mc_timer_init_debug(qdf_mc_timer_t *timer, timer->timer_node = qdf_mem_malloc(sizeof(qdf_mc_timer_node_t)); - if (timer->timer_node == NULL) { - QDF_TRACE(QDF_MODULE_ID_QDF, QDF_TRACE_LEVEL_ERROR, - "%s: Not able to allocate memory for time_node", - __func__); + if (!timer->timer_node) { QDF_ASSERT(0); return QDF_STATUS_E_NOMEM; } diff --git a/qdf/linux/src/qdf_mem.c b/qdf/linux/src/qdf_mem.c index 34a31f828f..814f43d47a 100644 --- a/qdf/linux/src/qdf_mem.c +++ b/qdf/linux/src/qdf_mem.c @@ -1268,28 +1268,21 @@ void qdf_mem_multi_pages_alloc(qdf_device_t osdev, /* Pages information storage */ pages->cacheable_pages = qdf_mem_malloc( pages->num_pages * sizeof(pages->cacheable_pages)); - if (!pages->cacheable_pages) { - qdf_print("Cacheable page storage alloc fail"); + if (!pages->cacheable_pages) goto out_fail; - } cacheable_pages = pages->cacheable_pages; for (page_idx = 0; page_idx < pages->num_pages; page_idx++) { cacheable_pages[page_idx] = qdf_mem_malloc(PAGE_SIZE); - if (!cacheable_pages[page_idx]) { - qdf_print("cacheable page alloc fail, pi %d", - page_idx); + if (!cacheable_pages[page_idx]) goto page_alloc_fail; - } } pages->dma_pages = NULL; } else { pages->dma_pages = qdf_mem_malloc( pages->num_pages * sizeof(struct qdf_mem_dma_page_t)); - if (!pages->dma_pages) { - qdf_print("dmaable page storage alloc fail"); + if (!pages->dma_pages) goto out_fail; - } dma_pages = pages->dma_pages; for (page_idx = 0; page_idx < pages->num_pages; page_idx++) { @@ -1476,10 +1469,8 @@ qdf_shared_mem_t *qdf_mem_shared_mem_alloc(qdf_device_t osdev, uint32_t size) int ret; shared_mem = qdf_mem_malloc(sizeof(*shared_mem)); - if (!shared_mem) { - qdf_err("Unable to allocate memory for shared resource struct"); + if (!shared_mem) return NULL; - } shared_mem->vaddr = qdf_mem_alloc_consistent(osdev, osdev->dev, size, qdf_mem_get_dma_addr_ptr(osdev,