Commit 4c303373 authored by YueHaibing's avatar YueHaibing Committed by David S. Miller

libcxgb: replace vmalloc and memset with vzalloc

Use vzalloc instead of the vmalloc, memset combo
Signed-off-by: default avatarYueHaibing <yuehaibing@huawei.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent c1907e53
...@@ -412,12 +412,10 @@ int cxgbi_ppm_init(void **ppm_pp, struct net_device *ndev, ...@@ -412,12 +412,10 @@ int cxgbi_ppm_init(void **ppm_pp, struct net_device *ndev,
ppmax * (sizeof(struct cxgbi_ppod_data)) + ppmax * (sizeof(struct cxgbi_ppod_data)) +
ppod_bmap_size * sizeof(unsigned long); ppod_bmap_size * sizeof(unsigned long);
ppm = vmalloc(alloc_sz); ppm = vzalloc(alloc_sz);
if (!ppm) if (!ppm)
goto release_ppm_pool; goto release_ppm_pool;
memset(ppm, 0, alloc_sz);
ppm->ppod_bmap = (unsigned long *)(&ppm->ppod_data[ppmax]); ppm->ppod_bmap = (unsigned long *)(&ppm->ppod_data[ppmax]);
if ((ppod_bmap_size >> 3) > (ppmax - ppmax_pool)) { if ((ppod_bmap_size >> 3) > (ppmax - ppmax_pool)) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment