net/mlx5: Fix error handling in load one
authorMaor Gottlieb <maorg@mellanox.com>
Sun, 31 Dec 2017 09:31:34 +0000 (11:31 +0200)
committerSaeed Mahameed <saeedm@mellanox.com>
Fri, 12 Jan 2018 00:01:47 +0000 (02:01 +0200)
We didn't store the result of mlx5_init_once, due to that
mlx5_load_one returned success on error.  Fix that.

Fixes: 59211bd3b632 ("net/mlx5: Split the load/unload flow into hardware and software flows")
Signed-off-by: Maor Gottlieb <maorg@mellanox.com>
Signed-off-by: Eugenia Emantayev <eugenia@mellanox.com>
Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
drivers/net/ethernet/mellanox/mlx5/core/main.c

index 6dffa58fb17873a849fcedad2ca7a3089c350a88..0f88fd30a09a0c52a889f68b1cbcade3c37ff56f 100644 (file)
@@ -1123,9 +1123,12 @@ static int mlx5_load_one(struct mlx5_core_dev *dev, struct mlx5_priv *priv,
                goto err_stop_poll;
        }
 
-       if (boot && mlx5_init_once(dev, priv)) {
-               dev_err(&pdev->dev, "sw objs init failed\n");
-               goto err_stop_poll;
+       if (boot) {
+               err = mlx5_init_once(dev, priv);
+               if (err) {
+                       dev_err(&pdev->dev, "sw objs init failed\n");
+                       goto err_stop_poll;
+               }
        }
 
        err = mlx5_alloc_irq_vectors(dev);