Change OSAL_VALLOC() into OSAL_VZALLOC() which would also zero memory.
Signed-off-by: Rasesh Mody <rasesh.mody@cavium.com>
#define OSAL_ALLOC(dev, GFP, size) rte_malloc("qede", size, 0)
#define OSAL_ZALLOC(dev, GFP, size) rte_zmalloc("qede", size, 0)
#define OSAL_CALLOC(dev, GFP, num, size) rte_calloc("qede", num, size, 0)
-#define OSAL_VALLOC(dev, size) rte_malloc("qede", size, 0)
+#define OSAL_VZALLOC(dev, size) rte_zmalloc("qede", size, 0)
#define OSAL_FREE(dev, memory) \
do { \
rte_free((void *)memory); \
u32 page_cnt = p_chain->page_cnt, size, i;
size = page_cnt * sizeof(*pp_virt_addr_tbl);
- pp_virt_addr_tbl = (void **)OSAL_VALLOC(p_dev, size);
+ pp_virt_addr_tbl = (void **)OSAL_VZALLOC(p_dev, size);
if (!pp_virt_addr_tbl) {
DP_NOTICE(p_dev, true,
"Failed to allocate memory for the chain virtual addresses table\n");
return ECORE_NOMEM;
}
- OSAL_MEM_ZERO(pp_virt_addr_tbl, size);
/* The allocation of the PBL table is done with its full size, since it
* is expected to be successive.
struct ecore_queue_cid *p_cid;
enum _ecore_status_t rc;
- p_cid = OSAL_VALLOC(p_hwfn->p_dev, sizeof(*p_cid));
+ p_cid = OSAL_VZALLOC(p_hwfn->p_dev, sizeof(*p_cid));
if (p_cid == OSAL_NULL)
return OSAL_NULL;
- OSAL_MEM_ZERO(p_cid, sizeof(*p_cid));
p_cid->opaque_fid = opaque_fid;
p_cid->cid = cid;
u32 offset;
int len;
- p_tlv_data = OSAL_VALLOC(p_hwfn->p_dev, sizeof(*p_tlv_data));
+ p_tlv_data = OSAL_VZALLOC(p_hwfn->p_dev, sizeof(*p_tlv_data));
if (!p_tlv_data)
return ECORE_NOMEM;
- OSAL_MEMSET(p_tlv_data, 0, sizeof(*p_tlv_data));
if (OSAL_MFW_FILL_TLV_DATA(p_hwfn, tlv_group, p_tlv_data)) {
OSAL_VFREE(p_hwfn->p_dev, p_tlv_data);
return ECORE_INVAL;
goto drv_done;
}
- p_mfw_buf = (void *)OSAL_VALLOC(p_hwfn->p_dev, size);
+ p_mfw_buf = (void *)OSAL_VZALLOC(p_hwfn->p_dev, size);
if (!p_mfw_buf) {
DP_NOTICE(p_hwfn, false,
"Failed allocate memory for p_mfw_buf\n");
goto out;
}
- p_rss_params = OSAL_VALLOC(p_hwfn->p_dev, sizeof(*p_rss_params));
+ p_rss_params = OSAL_VZALLOC(p_hwfn->p_dev, sizeof(*p_rss_params));
if (p_rss_params == OSAL_NULL) {
status = PFVF_STATUS_FAILURE;
goto out;