Skip to content

Commit

Permalink
fsl/fman: fix eth hash table allocation
Browse files Browse the repository at this point in the history
[ Upstream commit 3207f71 ]

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: 57ba4c9 ("fsl/fman: Add FMan MAC support")
Signed-off-by: Florinel Iordache <florinel.iordache@nxp.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
  • Loading branch information
florineliordache authored and gregkh committed Aug 19, 2020
1 parent 2997cea commit 3084ecb
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/net/ethernet/freescale/fman/fman_mac.h
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ static inline struct eth_hash_t *alloc_hash_table(u16 size)
struct eth_hash_t *hash;

/* Allocate address hash table */
hash = kmalloc_array(size, sizeof(struct eth_hash_t *), GFP_KERNEL);
hash = kmalloc(sizeof(*hash), GFP_KERNEL);
if (!hash)
return NULL;

Expand Down

0 comments on commit 3084ecb

Please sign in to comment.