[PATCH] staging: rtl8192u: use kzalloc to allocate firmware pointer

Devendra Naga devendra.aaru at gmail.com
Sun Aug 26 05:36:33 UTC 2012


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 at gmail.com>
---
 drivers/staging/rtl8192u/r8192U_core.c |    4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/staging/rtl8192u/r8192U_core.c b/drivers/staging/rtl8192u/r8192U_core.c
index 5981d66..5c132ac 100644
--- a/drivers/staging/rtl8192u/r8192U_core.c
+++ b/drivers/staging/rtl8192u/r8192U_core.c
@@ -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);
-- 
1.7.9.5




More information about the devel mailing list