Patchwork [net,5/5] net/mlx4_core: Return the error value in case of command initialization failure

login
register
mail settings
Submitter Yevgeny Petrilin
Date Sept. 6, 2012, 8:50 a.m.
Message ID <1346921452-2035-6-git-send-email-yevgenyp@mellanox.com>
Download mbox | patch
Permalink /patch/182097/
State Accepted
Delegated to: David Miller
Headers show

Comments

Yevgeny Petrilin - Sept. 6, 2012, 8:50 a.m.
From: Eugenia Emantayev <eugenia@mellanox.com>

If mlx4_cmd_init() failed, the init_one function returned
success, although no resources were opened.

Signed-off-by: Eugenia Emantayev <eugenia@mellanox.com>
Signed-off-by: Yevgeny Petrilin <yevgenyp@mellanox.com>
---
 drivers/net/ethernet/mellanox/mlx4/main.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

Patch

diff --git a/drivers/net/ethernet/mellanox/mlx4/main.c b/drivers/net/ethernet/mellanox/mlx4/main.c
index 0fadac5..2f816c6 100644
--- a/drivers/net/ethernet/mellanox/mlx4/main.c
+++ b/drivers/net/ethernet/mellanox/mlx4/main.c
@@ -1997,7 +1997,8 @@  static int __mlx4_init_one(struct pci_dev *pdev, const struct pci_device_id *id)
 	}
 
 slave_start:
-	if (mlx4_cmd_init(dev)) {
+	err = mlx4_cmd_init(dev);
+	if (err) {
 		mlx4_err(dev, "Failed to init command interface, aborting.\n");
 		goto err_sriov;
 	}