Skip to content

Commit

Permalink
staging: rtl8192u: use kzalloc to allocate firmware pointer
Browse files Browse the repository at this point in the history
the firmware pointer is allocated with kmalloc and memset,
instead we can just do a kzalloc which will return a memory that
has been memset.

Signed-off-by: Devendra Naga <devendra.aaru@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
Devendra Naga authored and Greg Kroah-Hartman committed Sep 4, 2012
1 parent 3cd84fb commit b755342
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions drivers/staging/rtl8192u/r8192U_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -2808,9 +2808,7 @@ static void rtl8192_init_priv_variable(struct net_device* dev)
(priv->EarlyRxThreshold == 7 ? RCR_ONLYERLPKT:0);

priv->AcmControl = 0;
priv->pFirmware = kmalloc(sizeof(rt_firmware), GFP_KERNEL);
if (priv->pFirmware)
memset(priv->pFirmware, 0, sizeof(rt_firmware));
priv->pFirmware = kzalloc(sizeof(rt_firmware), GFP_KERNEL);

/* rx related queue */
skb_queue_head_init(&priv->rx_queue);
Expand Down

0 comments on commit b755342

Please sign in to comment.