]> git.baikalelectronics.ru Git - kernel.git/commit
net/mlx4_core: Fix error handling in mlx4_init_port_info.
authorTarick Bedeir <tarick@google.com>
Sun, 13 May 2018 23:38:45 +0000 (16:38 -0700)
committerDavid S. Miller <davem@davemloft.net>
Mon, 14 May 2018 20:29:08 +0000 (16:29 -0400)
commit71c6ce227d743d2f19fa3c706a4c46af5f6a4997
tree9d6d421a3d6e40a33d29704d3df85ec0a8ebef21
parent28a2f9360fa754a3743000ee975b685f025c68d8
net/mlx4_core: Fix error handling in mlx4_init_port_info.

Avoid exiting the function with a lingering sysfs file (if the first
call to device_create_file() fails while the second succeeds), and avoid
calling devlink_port_unregister() twice.

In other words, either mlx4_init_port_info() succeeds and returns zero, or
it fails, returns non-zero, and requires no cleanup.

Fixes: 70510654cf41 ("mlx4_core: Allow dynamic MTU configuration for IB ports")
Signed-off-by: Tarick Bedeir <tarick@google.com>
Reviewed-by: Leon Romanovsky <leonro@mellanox.com>
Reviewed-by: Tariq Toukan <tariqt@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/mellanox/mlx4/main.c