summaryrefslogtreecommitdiff
path: root/drivers/net
diff options
context:
space:
mode:
authorKleber Sacilotto de Souza <klebers@linux.vnet.ibm.com>2013-02-22 14:58:02 +0000
committerDavid S. Miller <davem@davemloft.net>2013-02-23 13:51:54 -0500
commit427a96252d8eee7b9bbafce15bd37fa3387ede55 (patch)
tree24a0628f9eef8870437491201f8a66aca0655e63 /drivers/net
parent1b63edd6ecc55c3a61b40297b49e2323783bddfd (diff)
downloadlinux-3.10-427a96252d8eee7b9bbafce15bd37fa3387ede55.tar.gz
linux-3.10-427a96252d8eee7b9bbafce15bd37fa3387ede55.tar.bz2
linux-3.10-427a96252d8eee7b9bbafce15bd37fa3387ede55.zip
mlx4_en: fix allocation of device tx_cq
The memory to hold the network device tx_cq is not being allocated with the correct size in mlx4_en_init_netdev(). It should use MAX_TX_RINGS instead of MAX_RX_RINGS. This can cause problems if the number of tx rings being used is greater than MAX_RX_RINGS. Signed-off-by: Kleber Sacilotto de Souza <klebers@linux.vnet.ibm.com> Acked-by: Amir Vadai <amirv@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/ethernet/mellanox/mlx4/en_netdev.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/net/ethernet/mellanox/mlx4/en_netdev.c b/drivers/net/ethernet/mellanox/mlx4/en_netdev.c
index 5088dc5c3d1..5944dd60b9e 100644
--- a/drivers/net/ethernet/mellanox/mlx4/en_netdev.c
+++ b/drivers/net/ethernet/mellanox/mlx4/en_netdev.c
@@ -2067,7 +2067,7 @@ int mlx4_en_init_netdev(struct mlx4_en_dev *mdev, int port,
err = -ENOMEM;
goto out;
}
- priv->tx_cq = kzalloc(sizeof(struct mlx4_en_cq) * MAX_RX_RINGS,
+ priv->tx_cq = kzalloc(sizeof(struct mlx4_en_cq) * MAX_TX_RINGS,
GFP_KERNEL);
if (!priv->tx_cq) {
err = -ENOMEM;