diff options
author | Christophe JAILLET <christophe.jaillet@wanadoo.fr> | 2020-01-25 22:18:47 +0100 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2020-01-27 11:13:53 +0100 |
commit | 6dd4b4f3936e17fedea1308bc70e9716f68bf232 (patch) | |
tree | e30859d123cd9a680ac1587ca96df6fd24183476 /drivers | |
parent | 6dc43cd3aae0ffeeaebe427e1bf5e5faf9de7d42 (diff) | |
download | linux-6dd4b4f3936e17fedea1308bc70e9716f68bf232.tar.bz2 |
mlxsw: minimal: Fix an error handling path in 'mlxsw_m_port_create()'
An 'alloc_etherdev()' called is not ballanced by a corresponding
'free_netdev()' call in one error handling path.
Slighly reorder the error handling code to catch the missed case.
Fixes: c100e47caa8e ("mlxsw: minimal: Add ethtool support")
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Reviewed-by: Ido Schimmel <idosch@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/net/ethernet/mellanox/mlxsw/minimal.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/net/ethernet/mellanox/mlxsw/minimal.c b/drivers/net/ethernet/mellanox/mlxsw/minimal.c index 2b543911ae00..c4caeeadcba9 100644 --- a/drivers/net/ethernet/mellanox/mlxsw/minimal.c +++ b/drivers/net/ethernet/mellanox/mlxsw/minimal.c @@ -213,8 +213,8 @@ mlxsw_m_port_create(struct mlxsw_m *mlxsw_m, u8 local_port, u8 module) err_register_netdev: mlxsw_m->ports[local_port] = NULL; - free_netdev(dev); err_dev_addr_get: + free_netdev(dev); err_alloc_etherdev: mlxsw_core_port_fini(mlxsw_m->core, local_port); return err; |