diff mbox

[net-next,2/3] net/mlx4_core: need to call close fw if alloc icm is called twice

Message ID 1433279245-5577-2-git-send-email-clsoto@linux.vnet.ibm.com
State Accepted, archived
Delegated to: David Miller
Headers show

Commit Message

clsoto@linux.vnet.ibm.com June 2, 2015, 9:07 p.m. UTC
From: Carol Soto <clsoto@linux.vnet.ibm.com>

If mlx4_enable_sriov is called by adapter without this
feature MLX4_DEV_CAP_FLAG2_SYS_EQS then during this path the function alloc
icm is called twice without freeing the structures from the first time.

Acked-by: Or Gerlitz <ogerlitz@mellanox.com>
Signed-off-by: Carol L Soto <clsoto@linux.vnet.ibm.com>
---
 drivers/net/ethernet/mellanox/mlx4/main.c | 1 +
 1 file changed, 1 insertion(+)

Comments

David Miller June 4, 2015, 3:13 a.m. UTC | #1
From: clsoto@linux.vnet.ibm.com
Date: Tue,  2 Jun 2015 16:07:24 -0500

> From: Carol Soto <clsoto@linux.vnet.ibm.com>
> 
> If mlx4_enable_sriov is called by adapter without this
> feature MLX4_DEV_CAP_FLAG2_SYS_EQS then during this path the function alloc
> icm is called twice without freeing the structures from the first time.
> 
> Acked-by: Or Gerlitz <ogerlitz@mellanox.com>
> Signed-off-by: Carol L Soto <clsoto@linux.vnet.ibm.com>

Applied.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/drivers/net/ethernet/mellanox/mlx4/main.c b/drivers/net/ethernet/mellanox/mlx4/main.c
index 9485cbe..7d57777 100644
--- a/drivers/net/ethernet/mellanox/mlx4/main.c
+++ b/drivers/net/ethernet/mellanox/mlx4/main.c
@@ -2976,6 +2976,7 @@  slave_start:
 								  existing_vfs,
 								  reset_flow);
 
+				mlx4_close_fw(dev);
 				mlx4_cmd_cleanup(dev, MLX4_CMD_CLEANUP_ALL);
 				dev->flags = dev_flags;
 				if (!SRIOV_VALID_STATE(dev->flags)) {