mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-05-06 03:06:50 -04:00
staging: rtl8712: use kmalloc_array
Adhere to Linux kernel coding style. Reported by checkpatch: WARNING: Prefer kmalloc_array over kmalloc with multiply + pxmitpriv->pxmitbuf = kmalloc(NR_XMITBUFF * sizeof(struct xmit_buf), GFP_ATOMIC); Signed-off-by: Tudor Gheorghiu <tudor.reda@gmail.com> Reviewed-by: Philipp Hortmann <philipp.g.hortmann@gmail.com> Link: https://lore.kernel.org/r/ZvBy2lB_ok_OCmVI@redaops Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
c1a5060ec8
commit
064894731c
@@ -117,7 +117,7 @@ int _r8712_init_xmit_priv(struct xmit_priv *pxmitpriv,
|
||||
/*init xmit_buf*/
|
||||
_init_queue(&pxmitpriv->free_xmitbuf_queue);
|
||||
_init_queue(&pxmitpriv->pending_xmitbuf_queue);
|
||||
pxmitpriv->pxmitbuf = kmalloc(NR_XMITBUFF * sizeof(struct xmit_buf), GFP_ATOMIC);
|
||||
pxmitpriv->pxmitbuf = kmalloc_array(NR_XMITBUFF, sizeof(struct xmit_buf), GFP_ATOMIC);
|
||||
if (!pxmitpriv->pxmitbuf)
|
||||
goto clean_up_frame_buf;
|
||||
pxmitbuf = (struct xmit_buf *)pxmitpriv->pxmitbuf;
|
||||
|
||||
Reference in New Issue
Block a user