[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <9a5de847-0913-420d-8cb0-35d95376ae5b@wanadoo.fr>
Date: Wed, 21 Aug 2024 14:08:45 +0200
From: Christophe JAILLET <christophe.jaillet@...adoo.fr>
To: Yu Jiaoliang <yujiaoliang@...o.com>,
Johannes Berg <johannes@...solutions.net>,
"David S. Miller" <davem@...emloft.net>, Eric Dumazet <edumazet@...gle.com>,
Jakub Kicinski <kuba@...nel.org>, Paolo Abeni <pabeni@...hat.com>,
linux-wireless@...r.kernel.org, netdev@...r.kernel.org,
linux-kernel@...r.kernel.org
Cc: opensource.kernel@...o.com
Subject: Re: [PATCH v2] wifi: cfg80211: Use kmemdup_array instead of kmemdup
for multiple allocation
Le 21/08/2024 à 13:12, Yu Jiaoliang a écrit :
> Let the kememdup_array() take care about multiplication and possible
> overflows.
>
> v2:
> -Change sizeof(limits[0]) to sizeof(*limits)
> -Fix title prefix
Hi,
this kind of information about differences between versions is usually
below the ---.
>
> Signed-off-by: Yu Jiaoliang <yujiaoliang@...o.com>
> Reviewed-by: Christophe JAILLET <christophe.jaillet@...adoo.fr>
It is not because someone makes a comment on a patch that you should
automatically add a R-b tag.
> Reviewed-by: Kalle Valo <kvalo@...nel.org>
> ---
> net/wireless/util.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/net/wireless/util.c b/net/wireless/util.c
> index 9a7c3adc8a3b..e7c1ac2a0f2d 100644
> --- a/net/wireless/util.c
> +++ b/net/wireless/util.c
> @@ -2435,8 +2435,8 @@ int cfg80211_iter_combinations(struct wiphy *wiphy,
> if (params->num_different_channels > c->num_different_channels)
> continue;
>
> - limits = kmemdup(c->limits, sizeof(limits[0]) * c->n_limits,
> - GFP_KERNEL);
> + limits = kmemdup_array(c->limits, c->n_limits, sizeof(*limits),
> + GFP_KERNEL);
> if (!limits)
> return -ENOMEM;
>
Reviewed-by: Christophe JAILLET <christophe.jaillet@...adoo.fr>
Now you can add my R-b :).
CJ
Powered by blists - more mailing lists