Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1328742
| From | Greg Kroah-Hartman <gregkh@linuxfoundation.org> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH 4/4] staging: rtl8192u: r8192U_core: use kmalloc_array instead of kmalloc |
| Date | 2016-02-08 05:00 +0100 |
| Message-ID | <qZL9v-7QE-3@gated-at.bofh.it> (permalink) |
| References | <qsz8J-1gC-9@gated-at.bofh.it> <qsz8K-1gC-29@gated-at.bofh.it> <qsz8J-1gC-7@gated-at.bofh.it> <qsz8K-1gC-27@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
On Sun, Nov 08, 2015 at 10:17:54PM +0800, Geliang Tang wrote:
> Use kmalloc_array instead of kmalloc to allocate memory for an array.
>
> Signed-off-by: Geliang Tang <geliangtang@163.com>
> ---
> drivers/staging/rtl8192u/r8192U_core.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/staging/rtl8192u/r8192U_core.c b/drivers/staging/rtl8192u/r8192U_core.c
> index e06864f..07a1447 100644
> --- a/drivers/staging/rtl8192u/r8192U_core.c
> +++ b/drivers/staging/rtl8192u/r8192U_core.c
> @@ -1725,8 +1725,8 @@ static short rtl8192_usb_initendpoints(struct net_device *dev)
> {
> struct r8192_priv *priv = ieee80211_priv(dev);
>
> - priv->rx_urb = kmalloc(sizeof(struct urb *) * (MAX_RX_URB + 1),
> - GFP_KERNEL);
> + priv->rx_urb = kmalloc_array(MAX_RX_URB + 1, sizeof(struct urb *),
> + GFP_KERNEL);
I don't see the benefit here with this change, do you?
Back to linux.kernel | Previous | Next | Find similar | Unroll thread
Re: [PATCH 4/4] staging: rtl8192u: r8192U_core: use kmalloc_array instead of kmalloc Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-02-08 05:00 +0100
csiph-web