summaryrefslogtreecommitdiff
path: root/drivers/staging/gdm72xx
diff options
context:
space:
mode:
authorDevendra Naga <devendra.aaru@gmail.com>2012-08-26 01:22:35 +0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-09-04 22:16:22 +0400
commit07ad99c9e32173852997523eb920950902563941 (patch)
tree67e1032da28cc8398b4948e2692f6c3f0480d4b9 /drivers/staging/gdm72xx
parent8f8b77bfdce811acbcf2248219a7aab5f92de938 (diff)
downloadlinux-07ad99c9e32173852997523eb920950902563941.tar.xz
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>
Diffstat (limited to 'drivers/staging/gdm72xx')
-rw-r--r--drivers/staging/gdm72xx/gdm_sdio.c4
-rw-r--r--drivers/staging/gdm72xx/gdm_usb.c4
2 files changed, 2 insertions, 6 deletions
diff --git a/drivers/staging/gdm72xx/gdm_sdio.c b/drivers/staging/gdm72xx/gdm_sdio.c
index 3e43c012ef27..ec64d94cd68c 100644
--- a/drivers/staging/gdm72xx/gdm_sdio.c
+++ b/drivers/staging/gdm72xx/gdm_sdio.c
@@ -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;
diff --git a/drivers/staging/gdm72xx/gdm_usb.c b/drivers/staging/gdm72xx/gdm_usb.c
index d48d49c145ee..c7a22fa55638 100644
--- a/drivers/staging/gdm72xx/gdm_usb.c
+++ b/drivers/staging/gdm72xx/gdm_usb.c
@@ -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)