net/mlx4_core: Fix to clean devlink resources
authorKamal Heib <kamalh@mellanox.com>
Tue, 20 Sep 2016 11:55:31 +0000 (14:55 +0300)
committerDavid S. Miller <davem@davemloft.net>
Thu, 22 Sep 2016 05:41:27 +0000 (01:41 -0400)
commitfba1296624bf95fc07057da1e26beee8a733180c
tree9b296bfe850046f955b7e4ca3442e75c0289178a
parent7932aa1e43b4d4117be7671bb299103e549aec11
net/mlx4_core: Fix to clean devlink resources

This patch cleans devlink resources by calling devlink_port_unregister()
to avoid the following issues:

- Kernel panic when triggering reset flow.
- Memory leak due to unfreed resources in mlx4_init_port_info().

Fixes: 09d4d087cd48 ("mlx4: Implement devlink interface")
Signed-off-by: Kamal Heib <kamalh@mellanox.com>
Signed-off-by: Tariq Toukan <tariqt@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/mellanox/mlx4/main.c