Commit cbee9f91 authored by Stephen Hemminger's avatar Stephen Hemminger Committed by Jeff Garzik

[PATCH] chelsio: use kzalloc

Use kzalloc() in chelsio driver.
Signed-off-by: default avatarStephen Hemminger <shemminger@osdl.org>
Signed-off-by: default avatarJeff Garzik <jeff@garzik.org>
parent 86c27d27
...@@ -335,10 +335,9 @@ static int alloc_rx_resources(struct sge *sge, struct sge_params *p) ...@@ -335,10 +335,9 @@ static int alloc_rx_resources(struct sge *sge, struct sge_params *p)
goto err_no_mem; goto err_no_mem;
memset(q->entries, 0, size); memset(q->entries, 0, size);
size = sizeof(struct freelQ_ce) * q->size; size = sizeof(struct freelQ_ce) * q->size;
q->centries = kmalloc(size, GFP_KERNEL); q->centries = kzalloc(size, GFP_KERNEL);
if (!q->centries) if (!q->centries)
goto err_no_mem; goto err_no_mem;
memset(q->centries, 0, size);
} }
/* /*
...@@ -463,10 +462,9 @@ static int alloc_tx_resources(struct sge *sge, struct sge_params *p) ...@@ -463,10 +462,9 @@ static int alloc_tx_resources(struct sge *sge, struct sge_params *p)
goto err_no_mem; goto err_no_mem;
memset(q->entries, 0, size); memset(q->entries, 0, size);
size = sizeof(struct cmdQ_ce) * q->size; size = sizeof(struct cmdQ_ce) * q->size;
q->centries = kmalloc(size, GFP_KERNEL); q->centries = kzalloc(size, GFP_KERNEL);
if (!q->centries) if (!q->centries)
goto err_no_mem; goto err_no_mem;
memset(q->centries, 0, size);
} }
/* /*
...@@ -1635,11 +1633,10 @@ static void espibug_workaround(void *data) ...@@ -1635,11 +1633,10 @@ static void espibug_workaround(void *data)
struct sge * __devinit t1_sge_create(struct adapter *adapter, struct sge * __devinit t1_sge_create(struct adapter *adapter,
struct sge_params *p) struct sge_params *p)
{ {
struct sge *sge = kmalloc(sizeof(*sge), GFP_KERNEL); struct sge *sge = kzalloc(sizeof(*sge), GFP_KERNEL);
if (!sge) if (!sge)
return NULL; return NULL;
memset(sge, 0, sizeof(*sge));
sge->adapter = adapter; sge->adapter = adapter;
sge->netdev = adapter->port[0].dev; sge->netdev = adapter->port[0].dev;
......
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