Staging: usbip: kmem_cache_alloc/memset -> kmem_cache_zalloc
authorWei Yongjun <yjwei@cn.fujitsu.com>
Fri, 6 Feb 2009 03:08:58 +0000 (11:08 +0800)
committerGreg Kroah-Hartman <gregkh@suse.de>
Fri, 3 Apr 2009 21:53:28 +0000 (14:53 -0700)
Used kmem_cache_zalloc instead of kmem_cache_alloc/memset.

Signed-off-by: Wei Yongjun <yjwei@cn.fujitsu.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/staging/usbip/stub_rx.c

index 2eb61372fe0a6d9a446fb2897a802c3b792aa0f8..1c710628df0d8dbf2bc76240a50c2fa70d68ead7 100644 (file)
@@ -334,7 +334,7 @@ static struct stub_priv *stub_priv_alloc(struct stub_device *sdev,
 
        spin_lock_irqsave(&sdev->priv_lock, flags);
 
-       priv = kmem_cache_alloc(stub_priv_cache, GFP_ATOMIC);
+       priv = kmem_cache_zalloc(stub_priv_cache, GFP_ATOMIC);
        if (!priv) {
                dev_err(&sdev->interface->dev, "alloc stub_priv\n");
                spin_unlock_irqrestore(&sdev->priv_lock, flags);
@@ -342,8 +342,6 @@ static struct stub_priv *stub_priv_alloc(struct stub_device *sdev,
                return NULL;
        }
 
-       memset(priv, 0, sizeof(struct stub_priv));
-
        priv->seqnum = pdu->base.seqnum;
        priv->sdev = sdev;