]> git.baikalelectronics.ru Git - kernel.git/commit
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)
committerDavid S. Miller <davem@davemloft.net>
Thu, 10 May 2018 21:46:45 +0000 (17:46 -0400)
commit6dbc1efe04233510ef3b66dece6728749df45702
tree3e090ecd45bd18ae2befdb161dda260d737418ed
parentdd87c76754fd5e77a421e1252029423f672d27c5
net/mlx4_en: Fix an error handling path in 'mlx4_en_init_netdev()'

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: 9fdc0c9037dc ("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>
drivers/net/ethernet/mellanox/mlx4/en_netdev.c