From 0185dda640a704ce41ca1489c6775451c5ff3dcf Mon Sep 17 00:00:00 2001 From: Antonio Quartulli Date: Sat, 24 May 2014 06:43:47 +0200 Subject: 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 Signed-off-by: Marek Lindner --- net/batman-adv/hash.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'net/batman-adv/hash.c') diff --git a/net/batman-adv/hash.c b/net/batman-adv/hash.c index 63bdf7e94f1e..7c1c63080e20 100644 --- a/net/batman-adv/hash.c +++ b/net/batman-adv/hash.c @@ -46,12 +46,12 @@ struct batadv_hashtable *batadv_hash_new(uint32_t size) if (!hash) return NULL; - hash->table = kmalloc(sizeof(*hash->table) * size, GFP_ATOMIC); + hash->table = kmalloc_array(size, sizeof(*hash->table), GFP_ATOMIC); if (!hash->table) goto free_hash; - hash->list_locks = kmalloc(sizeof(*hash->list_locks) * size, - GFP_ATOMIC); + hash->list_locks = kmalloc_array(size, sizeof(*hash->list_locks), + GFP_ATOMIC); if (!hash->list_locks) goto free_table; -- cgit v1.2.3