libcxgb: replace vmalloc and memset with vzalloc

Use vzalloc instead of the vmalloc, memset combo

Signed-off-by: YueHaibing <yuehaibing@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
YueHaibing 2018-07-19 22:18:27 +08:00 committed by David S. Miller
parent c1907e53ab
commit 4c30337349

View File

@ -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)) {