net/mlx4_en: Fix an error handling path in 'mlx4_en_init_netdev()'
authorChristophe JAILLET <christophe.jaillet@wanadoo.fr>
Thu, 10 May 2018 07:06:04 +0000 (09:06 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 19 May 2018 08:20:23 +0000 (10:20 +0200)
commit2213a18303a2ac05d964e2551b2eab0b2a0aa334
treea447f46aa6da8e38d976a44986051626d7e63643
parent6b10014800ce0191218a4e8a2fe8447fc001439d
net/mlx4_en: Fix an error handling path in 'mlx4_en_init_netdev()'

[ Upstream commit a577d868b768a3baf16cdd4841ab8cfb165521d6 ]

If an error occurs, 'mlx4_en_destroy_netdev()' is called.
It then calls 'mlx4_en_free_resources()' which does the needed resources
cleanup.

So, doing some explicit kfree in the error handling path would lead to
some double kfree.

Simplify code to avoid such a case.

Fixes: 67f8b1dcb9ee ("net/mlx4_en: Refactor the XDP forwarding rings scheme")
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Reviewed-by: Tariq Toukan <tariqt@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/net/ethernet/mellanox/mlx4/en_netdev.c