diff options
author | Antonio Quartulli <antonio@meshcoding.com> | 2014-05-24 06:43:47 +0200 |
---|---|---|
committer | Antonio Quartulli <antonio@meshcoding.com> | 2014-08-04 16:02:10 +0200 |
commit | 0185dda640a704ce41ca1489c6775451c5ff3dcf (patch) | |
tree | fd50f60be3bc3c506618f13c14d4a1794414ff19 /net/batman-adv/distributed-arp-table.c | |
parent | e6b92c25d20c64c271ef429bba8febeefb848b5b (diff) | |
download | linux-exynos-0185dda640a704ce41ca1489c6775451c5ff3dcf.tar.gz linux-exynos-0185dda640a704ce41ca1489c6775451c5ff3dcf.tar.bz2 linux-exynos-0185dda640a704ce41ca1489c6775451c5ff3dcf.zip |
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>
Diffstat (limited to 'net/batman-adv/distributed-arp-table.c')
-rw-r--r-- | net/batman-adv/distributed-arp-table.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/net/batman-adv/distributed-arp-table.c b/net/batman-adv/distributed-arp-table.c index f2c066b21716..b5981113c9a7 100644 --- a/net/batman-adv/distributed-arp-table.c +++ b/net/batman-adv/distributed-arp-table.c @@ -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; |