net/mlx4_core: Return the error value in case of command initialization failure
authorEugenia Emantayev <eugenia@mellanox.com>
Wed, 5 Sep 2012 22:50:52 +0000 (22:50 +0000)
committerDavid S. Miller <davem@davemloft.net>
Fri, 7 Sep 2012 16:55:59 +0000 (12:55 -0400)
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>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/mellanox/mlx4/main.c

index 0fadac546b00b752b4671a08fef8b40367c74a4a..2f816c6aed72da16bc6afc22c957f0b6c7a5eac0 100644 (file)
@@ -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;
        }