qcacmn: Remove error log for qdf_mem_malloc in hif/htc files

qdf layer already has the error trace

Change-Id: I83441fb5ab2e954f670f2891ecec8fccf5abf9a7
CRs-Fixed: 2376419
This commit is contained in:
Madhvapathi Sriram
2019-01-07 09:17:29 +05:30
committed by nshrivas
parent a702362d34
commit bfb0112412
11 changed files with 27 additions and 52 deletions

View File

@@ -72,10 +72,8 @@ static ssize_t ath_procfs_diag_read(struct file *file, char __user *buf,
return -EINVAL; return -EINVAL;
read_buffer = qdf_mem_malloc(count); read_buffer = qdf_mem_malloc(count);
if (NULL == read_buffer) { if (!read_buffer)
HIF_ERROR("%s: cdf_mem_alloc failed", __func__);
return -ENOMEM; return -ENOMEM;
}
HIF_DBG("rd buff 0x%pK cnt %zu offset 0x%x buf 0x%pK", HIF_DBG("rd buff 0x%pK cnt %zu offset 0x%x buf 0x%pK",
read_buffer, count, (int)*pos, buf); read_buffer, count, (int)*pos, buf);
@@ -141,10 +139,9 @@ static ssize_t ath_procfs_diag_write(struct file *file,
return -EINVAL; return -EINVAL;
write_buffer = qdf_mem_malloc(count); write_buffer = qdf_mem_malloc(count);
if (NULL == write_buffer) { if (!write_buffer)
HIF_ERROR("%s: cdf_mem_alloc failed", __func__);
return -ENOMEM; return -ENOMEM;
}
if (copy_from_user(write_buffer, buf, count)) { if (copy_from_user(write_buffer, buf, count)) {
qdf_mem_free(write_buffer); qdf_mem_free(write_buffer);
HIF_ERROR("%s: copy_to_user error in /proc/%s", HIF_ERROR("%s: copy_to_user error in /proc/%s",

View File

@@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2015-2018 The Linux Foundation. All rights reserved. * Copyright (c) 2015-2019 The Linux Foundation. All rights reserved.
* *
* Permission to use, copy, modify, and/or distribute this software for * Permission to use, copy, modify, and/or distribute this software for
* any purpose with or without fee is hereby granted, provided that the * any purpose with or without fee is hereby granted, provided that the
@@ -149,10 +149,9 @@ QDF_STATUS hif_exchange_bmi_msg(struct hif_opaque_softc *hif_ctx,
transaction = transaction =
(struct BMI_transaction *)qdf_mem_malloc(sizeof(*transaction)); (struct BMI_transaction *)qdf_mem_malloc(sizeof(*transaction));
if (unlikely(!transaction)) { if (unlikely(!transaction))
HIF_ERROR("%s: no memory", __func__);
return QDF_STATUS_E_NOMEM; return QDF_STATUS_E_NOMEM;
}
transaction_id = (mux_id & MUX_ID_MASK) | transaction_id = (mux_id & MUX_ID_MASK) |
(transaction_id & TRANSACTION_ID_MASK); (transaction_id & TRANSACTION_ID_MASK);
#ifdef QCA_WIFI_3_0 #ifdef QCA_WIFI_3_0

View File

@@ -1424,10 +1424,9 @@ struct CE_handle *ce_init(struct hif_softc *scn,
if (!CE_state) { if (!CE_state) {
CE_state = CE_state =
(struct CE_state *)qdf_mem_malloc(sizeof(*CE_state)); (struct CE_state *)qdf_mem_malloc(sizeof(*CE_state));
if (!CE_state) { if (!CE_state)
HIF_ERROR("%s: CE_state has no mem", __func__);
return NULL; return NULL;
}
malloc_CE_state = true; malloc_CE_state = true;
qdf_spinlock_create(&CE_state->ce_index_lock); qdf_spinlock_create(&CE_state->ce_index_lock);
@@ -1492,11 +1491,9 @@ struct CE_handle *ce_init(struct hif_softc *scn,
qdf_mem_malloc(nentries * qdf_mem_malloc(nentries *
sizeof(struct CE_src_desc) + sizeof(struct CE_src_desc) +
CE_DESC_RING_ALIGN); CE_DESC_RING_ALIGN);
if (src_ring->shadow_base_unaligned == NULL) { if (!src_ring->shadow_base_unaligned)
HIF_ERROR("%s: src ring no shadow_base mem",
__func__);
goto error_no_dma_mem; goto error_no_dma_mem;
}
src_ring->shadow_base = (struct CE_src_desc *) src_ring->shadow_base = (struct CE_src_desc *)
(((size_t) src_ring->shadow_base_unaligned + (((size_t) src_ring->shadow_base_unaligned +
CE_DESC_RING_ALIGN - 1) & CE_DESC_RING_ALIGN - 1) &

View File

@@ -181,7 +181,6 @@ int hif_napi_create(struct hif_opaque_softc *hif_ctx,
napii = qdf_mem_malloc(sizeof(*napii)); napii = qdf_mem_malloc(sizeof(*napii));
napid->napis[i] = napii; napid->napis[i] = napii;
if (!napii) { if (!napii) {
NAPI_DEBUG("NAPI alloc failure %d", i);
rc = -ENOMEM; rc = -ENOMEM;
goto napii_free; goto napii_free;
} }

View File

@@ -4261,11 +4261,8 @@ int hif_runtime_lock_init(qdf_runtime_lock_t *lock, const char *name)
HIF_INFO("Initializing Runtime PM wakelock %s", name); HIF_INFO("Initializing Runtime PM wakelock %s", name);
context = qdf_mem_malloc(sizeof(*context)); context = qdf_mem_malloc(sizeof(*context));
if (!context) { if (!context)
HIF_ERROR("%s: No memory for Runtime PM wakelock context",
__func__);
return -ENOMEM; return -ENOMEM;
}
context->name = name ? name : "Default"; context->name = name ? name : "Default";
lock->lock = context; lock->lock = context;

View File

@@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2013-2018 The Linux Foundation. All rights reserved. * Copyright (c) 2013-2019 The Linux Foundation. All rights reserved.
* *
* Permission to use, copy, modify, and/or distribute this software for * Permission to use, copy, modify, and/or distribute this software for
* any purpose with or without fee is hereby granted, provided that the * any purpose with or without fee is hereby granted, provided that the
@@ -1416,16 +1416,14 @@ static struct hif_sdio_dev *add_hif_device(struct sdio_func *func)
hifdevice = (struct hif_sdio_dev *) qdf_mem_malloc(sizeof( hifdevice = (struct hif_sdio_dev *) qdf_mem_malloc(sizeof(
struct hif_sdio_dev)); struct hif_sdio_dev));
AR_DEBUG_ASSERT(hifdevice != NULL); AR_DEBUG_ASSERT(hifdevice != NULL);
if (hifdevice == NULL) { if (!hifdevice)
AR_DEBUG_PRINTF(ATH_DEBUG_ERROR, ("Alloc hif device fail\n"));
return NULL; return NULL;
}
#if HIF_USE_DMA_BOUNCE_BUFFER #if HIF_USE_DMA_BOUNCE_BUFFER
hifdevice->dma_buffer = qdf_mem_malloc(HIF_DMA_BUFFER_SIZE); hifdevice->dma_buffer = qdf_mem_malloc(HIF_DMA_BUFFER_SIZE);
AR_DEBUG_ASSERT(hifdevice->dma_buffer != NULL); AR_DEBUG_ASSERT(hifdevice->dma_buffer != NULL);
if (hifdevice->dma_buffer == NULL) { if (hifdevice->dma_buffer == NULL) {
qdf_mem_free(hifdevice); qdf_mem_free(hifdevice);
AR_DEBUG_PRINTF(ATH_DEBUG_ERROR, ("Alloc dma buffer fail\n"));
return NULL; return NULL;
} }
#endif #endif

View File

@@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2013-2018 The Linux Foundation. All rights reserved. * Copyright (c) 2013-2019 The Linux Foundation. All rights reserved.
* *
* *
* *
@@ -130,13 +130,10 @@ QDF_STATUS hif_dev_send_buffer(struct hif_sdio_device *pdev, uint32_t xfer_id,
} else { } else {
sctx = (struct hif_sendContext *)qdf_mem_malloc(sizeof(*sctx) + sctx = (struct hif_sendContext *)qdf_mem_malloc(sizeof(*sctx) +
padded_length); padded_length);
if (sctx) { if (sctx)
sctx->bNewAlloc = true; sctx->bNewAlloc = true;
} else { else
HIF_ERROR("%s: Alloc send context fail %zu\n",
__func__, sizeof(*sctx) + padded_length);
return QDF_STATUS_E_NOMEM; return QDF_STATUS_E_NOMEM;
}
} }
sctx->netbuf = buf; sctx->netbuf = buf;

View File

@@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2013-2018 The Linux Foundation. All rights reserved. * Copyright (c) 2013-2019 The Linux Foundation. All rights reserved.
* *
* Permission to use, copy, modify, and/or distribute this software for * Permission to use, copy, modify, and/or distribute this software for
* any purpose with or without fee is hereby granted, provided that the * any purpose with or without fee is hereby granted, provided that the
@@ -175,8 +175,7 @@ static QDF_STATUS hif_send_internal(struct HIF_DEVICE_USB *hif_usb_device,
send_context = send_context =
qdf_mem_malloc(sizeof(struct hif_usb_send_context) qdf_mem_malloc(sizeof(struct hif_usb_send_context)
+ head_data_len + nbytes); + head_data_len + nbytes);
if (send_context == NULL) { if (!send_context) {
HIF_ERROR("%s: qdf_mem_malloc failed", __func__);
status = QDF_STATUS_E_NOMEM; status = QDF_STATUS_E_NOMEM;
goto err; goto err;
} }

View File

@@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2013-2018 The Linux Foundation. All rights reserved. * Copyright (c) 2013-2019 The Linux Foundation. All rights reserved.
* *
* Permission to use, copy, modify, and/or distribute this software for * Permission to use, copy, modify, and/or distribute this software for
* any purpose with or without fee is hereby granted, provided that the * any purpose with or without fee is hereby granted, provided that the
@@ -634,10 +634,9 @@ void hif_fw_assert_ramdump_pattern(struct hif_usb_softc *sc)
sc->ramdump[i] = sc->ramdump[i] =
qdf_mem_malloc(sizeof(struct fw_ramdump) + qdf_mem_malloc(sizeof(struct fw_ramdump) +
fw_ram_reg_size[i]); fw_ram_reg_size[i]);
if (!sc->ramdump[i]) { if (!sc->ramdump[i])
pr_err("Fail to allocate memory for ram dump");
QDF_BUG(0); QDF_BUG(0);
}
(sc->ramdump[i])->mem = (uint8_t *) (sc->ramdump[i] + 1); (sc->ramdump[i])->mem = (uint8_t *) (sc->ramdump[i] + 1);
fw_ram_seg_addr[i] = (sc->ramdump[i])->mem; fw_ram_seg_addr[i] = (sc->ramdump[i])->mem;
HIF_ERROR("FW %s start addr = %#08x\n", HIF_ERROR("FW %s start addr = %#08x\n",

View File

@@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2013-2018 The Linux Foundation. All rights reserved. * Copyright (c) 2013-2019 The Linux Foundation. All rights reserved.
* *
* Permission to use, copy, modify, and/or distribute this software for * Permission to use, copy, modify, and/or distribute this software for
* any purpose with or without fee is hereby granted, provided that the * any purpose with or without fee is hereby granted, provided that the
@@ -151,15 +151,14 @@ static QDF_STATUS usb_hif_alloc_pipe_resources
for (i = 0; i < urb_cnt; i++) { for (i = 0; i < urb_cnt; i++) {
urb_context = qdf_mem_malloc(sizeof(*urb_context)); urb_context = qdf_mem_malloc(sizeof(*urb_context));
if (NULL == urb_context) { if (!urb_context) {
status = QDF_STATUS_E_NOMEM; status = QDF_STATUS_E_NOMEM;
HIF_ERROR("urb_context is null");
break; break;
} }
urb_context->pipe = pipe; urb_context->pipe = pipe;
urb_context->urb = usb_alloc_urb(0, GFP_KERNEL); urb_context->urb = usb_alloc_urb(0, GFP_KERNEL);
if (NULL == urb_context->urb) { if (!urb_context->urb) {
status = QDF_STATUS_E_NOMEM; status = QDF_STATUS_E_NOMEM;
qdf_mem_free(urb_context); qdf_mem_free(urb_context);
HIF_ERROR("urb_context->urb is null"); HIF_ERROR("urb_context->urb is null");

View File

@@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2013-2018 The Linux Foundation. All rights reserved. * Copyright (c) 2013-2019 The Linux Foundation. All rights reserved.
* *
* Permission to use, copy, modify, and/or distribute this software for * Permission to use, copy, modify, and/or distribute this software for
* any purpose with or without fee is hereby granted, provided that the * any purpose with or without fee is hereby granted, provided that the
@@ -61,7 +61,6 @@ static void destroy_htc_tx_ctrl_packet(HTC_PACKET *pPacket)
qdf_nbuf_t netbuf; qdf_nbuf_t netbuf;
netbuf = (qdf_nbuf_t) GET_HTC_PACKET_NET_BUF_CONTEXT(pPacket); netbuf = (qdf_nbuf_t) GET_HTC_PACKET_NET_BUF_CONTEXT(pPacket);
AR_DEBUG_PRINTF(ATH_DEBUG_TRC, ("free ctrl netbuf :0x%pK\n", netbuf));
if (netbuf != NULL) if (netbuf != NULL)
qdf_nbuf_free(netbuf); qdf_nbuf_free(netbuf);
qdf_mem_free(pPacket); qdf_mem_free(pPacket);
@@ -81,11 +80,8 @@ static HTC_PACKET *build_htc_tx_ctrl_packet(qdf_device_t osdev)
if (NULL == netbuf) { if (NULL == netbuf) {
qdf_mem_free(pPacket); qdf_mem_free(pPacket);
pPacket = NULL; pPacket = NULL;
qdf_print("%s: nbuf alloc failed", __func__);
break; break;
} }
AR_DEBUG_PRINTF(ATH_DEBUG_TRC,
("alloc ctrl netbuf :0x%pK\n", netbuf));
SET_HTC_PACKET_NET_BUF_CONTEXT(pPacket, netbuf); SET_HTC_PACKET_NET_BUF_CONTEXT(pPacket, netbuf);
} while (false); } while (false);
@@ -268,10 +264,8 @@ HTC_HANDLE htc_create(void *ol_sc, struct htc_init_info *pInfo,
A_REGISTER_MODULE_DEBUG_INFO(htc); A_REGISTER_MODULE_DEBUG_INFO(htc);
target = (HTC_TARGET *) qdf_mem_malloc(sizeof(HTC_TARGET)); target = (HTC_TARGET *) qdf_mem_malloc(sizeof(HTC_TARGET));
if (target == NULL) { if (!target)
HTC_ERROR("%s: Unable to allocate memory", __func__);
return NULL; return NULL;
}
htc_runtime_pm_init(target); htc_runtime_pm_init(target);
htc_credit_history_init(); htc_credit_history_init();