batman-adv: prefer kmalloc_array to kmalloc when possible
Reported by checkpatch with the following warning: WARNING: Prefer kmalloc_array over kmalloc with multiply Signed-off-by: Antonio Quartulli <antonio@meshcoding.com> Signed-off-by: Marek Lindner <mareklindner@neomailbox.ch>
This commit is contained in:
@@ -537,7 +537,8 @@ batadv_dat_select_candidates(struct batadv_priv *bat_priv, __be32 ip_dst)
|
||||
if (!bat_priv->orig_hash)
|
||||
return NULL;
|
||||
|
||||
res = kmalloc(BATADV_DAT_CANDIDATES_NUM * sizeof(*res), GFP_ATOMIC);
|
||||
res = kmalloc_array(BATADV_DAT_CANDIDATES_NUM, sizeof(*res),
|
||||
GFP_ATOMIC);
|
||||
if (!res)
|
||||
return NULL;
|
||||
|
||||
|
Reference in New Issue
Block a user