Skip to content

Commit 6dd4b4f

Browse files
tititiou36davem330
authored andcommitted
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: c100e47 ("mlxsw: minimal: Add ethtool support") Signed-off-by: Christophe JAILLET <[email protected]> Reviewed-by: Ido Schimmel <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 6dc43cd commit 6dd4b4f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/net/ethernet/mellanox/mlxsw/minimal.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -213,8 +213,8 @@ mlxsw_m_port_create(struct mlxsw_m *mlxsw_m, u8 local_port, u8 module)
213213

214214
err_register_netdev:
215215
mlxsw_m->ports[local_port] = NULL;
216-
free_netdev(dev);
217216
err_dev_addr_get:
217+
free_netdev(dev);
218218
err_alloc_etherdev:
219219
mlxsw_core_port_fini(mlxsw_m->core, local_port);
220220
return err;

0 commit comments

Comments
 (0)