2
0
mirror of https://github.com/edk2-porting/linux-next.git synced 2024-12-26 06:04:14 +08:00

staging: gdm72xx: use kzalloc to allocate usb_tx structure

the code under alloc_tx_struct does the allocation of usb_tx structure
using kmalloc, and memsets the allocated pointer, instead we can
directly use kzalloc so that the allocated memory is set with
zeros

Signed-off-by: Devendra Naga <devendra.aaru@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
Devendra Naga 2012-08-26 02:52:35 +05:30 committed by Greg Kroah-Hartman
parent 8f8b77bfdc
commit 07ad99c9e3
2 changed files with 2 additions and 6 deletions

View File

@ -62,12 +62,10 @@ static struct sdio_tx *alloc_tx_struct(struct tx_cxt *tx)
{
struct sdio_tx *t = NULL;
t = kmalloc(sizeof(*t), GFP_ATOMIC);
t = kzalloc(sizeof(*t), GFP_ATOMIC);
if (t == NULL)
goto out;
memset(t, 0, sizeof(*t));
t->buf = kmalloc(TX_BUF_SIZE, GFP_ATOMIC);
if (t->buf == NULL)
goto out;

View File

@ -75,12 +75,10 @@ static struct usb_tx *alloc_tx_struct(struct tx_cxt *tx)
{
struct usb_tx *t = NULL;
t = kmalloc(sizeof(*t), GFP_ATOMIC);
t = kzalloc(sizeof(*t), GFP_ATOMIC);
if (t == NULL)
goto out;
memset(t, 0, sizeof(*t));
t->urb = usb_alloc_urb(0, GFP_ATOMIC);
t->buf = kmalloc(TX_BUF_SIZE, GFP_ATOMIC);
if (t->urb == NULL || t->buf == NULL)