mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-07 19:30:30 +09:00
mlxsw: minimal: Fix an error handling path in 'mlxsw_m_port_create()'
[ Upstream commit6dd4b4f393] 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:c100e47caa("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> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
3c8c966cc7
commit
73226c7474
@@ -204,8 +204,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;
|
||||
|
||||
Reference in New Issue
Block a user