Skip to content

Commit

Permalink
Staging: usbip: kmem_cache_alloc/memset -> kmem_cache_zalloc
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Wei Yongjun authored and Greg Kroah-Hartman committed Apr 3, 2009
1 parent c62d843 commit e68f284
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions drivers/staging/usbip/stub_rx.c
Original file line number Diff line number Diff line change
Expand Up @@ -334,16 +334,14 @@ 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);
usbip_event_add(ud, SDEV_EVENT_ERROR_MALLOC);
return NULL;
}

memset(priv, 0, sizeof(struct stub_priv));

priv->seqnum = pdu->base.seqnum;
priv->sdev = sdev;

Expand Down

0 comments on commit e68f284

Please sign in to comment.