Staging: rtl8712: use kmalloc_array over kmalloc
authorTapasweni Pathak <tapaswenipathak@gmail.com>
Sun, 21 Sep 2014 00:19:41 +0000 (05:49 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 23 Sep 2014 15:11:56 +0000 (08:11 -0700)
This patch fixes checkpatch.pl warning in file rtl871x_xmit.c
WARNING : prefer kmalloc_array over kmalloc with multiply

Signed-off-by: Tapasweni Pathak <tapaswenipathak@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/rtl8712/rtl871x_xmit.c

index ca7e6e4..f49acaf 100644 (file)
@@ -955,8 +955,8 @@ static void alloc_hwxmits(struct _adapter *padapter)
        struct xmit_priv *pxmitpriv = &padapter->xmitpriv;
 
        pxmitpriv->hwxmit_entry = HWXMIT_ENTRY;
-       pxmitpriv->hwxmits = kmalloc(sizeof(struct hw_xmit) * pxmitpriv->hwxmit_entry,
-                                    GFP_ATOMIC);
+       pxmitpriv->hwxmits = kmalloc_array(pxmitpriv->hwxmit_entry,
+                               sizeof(struct hw_xmit), GFP_ATOMIC);
        if (pxmitpriv->hwxmits == NULL)
                return;
        hwxmits = pxmitpriv->hwxmits;