diff options
author | Tudor Gheorghiu <tudor.reda@gmail.com> | 2024-09-22 22:41:14 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2024-10-09 11:55:51 +0200 |
commit | 064894731cb4f905325e4c8356bca88fb41039d3 (patch) | |
tree | 4f0a20185fab543bf0e592cc6b764c1c211e1ea3 /drivers/staging/rtl8712 | |
parent | c1a5060ec80020ce879fa5b2a16875bd9a5ab930 (diff) |
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>
Diffstat (limited to 'drivers/staging/rtl8712')
-rw-r--r-- | drivers/staging/rtl8712/rtl871x_xmit.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/staging/rtl8712/rtl871x_xmit.c b/drivers/staging/rtl8712/rtl871x_xmit.c index 408616e9afcf..a0f29fab3dce 100644 --- a/drivers/staging/rtl8712/rtl871x_xmit.c +++ b/drivers/staging/rtl8712/rtl871x_xmit.c @@ -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; |