Commit 3207f715 authored by Florinel Iordache's avatar Florinel Iordache Committed by David S. Miller

fsl/fman: fix eth hash table allocation

Fix memory allocation for ethernet address hash table.
The code was wrongly allocating an array for eth hash table which
is incorrect because this is the main structure for eth hash table
(struct eth_hash_t) that contains inside a number of elements.

Fixes: 57ba4c9b ("fsl/fman: Add FMan MAC support")
Signed-off-by: default avatarFlorinel Iordache <florinel.iordache@nxp.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent cc5d229a
...@@ -252,7 +252,7 @@ static inline struct eth_hash_t *alloc_hash_table(u16 size) ...@@ -252,7 +252,7 @@ static inline struct eth_hash_t *alloc_hash_table(u16 size)
struct eth_hash_t *hash; struct eth_hash_t *hash;
/* Allocate address hash table */ /* Allocate address hash table */
hash = kmalloc_array(size, sizeof(struct eth_hash_t *), GFP_KERNEL); hash = kmalloc(sizeof(*hash), GFP_KERNEL);
if (!hash) if (!hash)
return NULL; return NULL;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment