net/mlx5: Fix error flow in case of function_setup failure
authorShay Drory <shayd@mellanox.com>
Wed, 6 May 2020 11:52:04 +0000 (14:52 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 3 Jun 2020 06:21:04 +0000 (08:21 +0200)
commitf493398fe0f7dff5d29759c90917d05e88cb3059
treeb51b141410fbcb2cba71bd412e29281ccd2c1607
parent9fe88c9408280db896ebf48ad5f725f68e0ce822
net/mlx5: Fix error flow in case of function_setup failure

[ Upstream commit 4f7400d5cbaef676e00cdffb0565bf731c6bb09e ]

Currently, if an error occurred during mlx5_function_setup(), we
keep dev->state as DEVICE_STATE_UP.
Fixing it by adding a goto label.

Fixes: e161105e58da ("net/mlx5: Function setup/teardown procedures")
Signed-off-by: Shay Drory <shayd@mellanox.com>
Reviewed-by: Moshe Shemesh <moshe@mellanox.com>
Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/net/ethernet/mellanox/mlx5/core/main.c