]> 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)
commitf641f2e768a0bde47ec1533dbf1e58fff5affcc0
tree9d6d421a3d6e40a33d29704d3df85ec0a8ebef21
parent04e6a1743d7bfd36bb0f036c0f825943853338c3
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: 138dd2d0c9cf ("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