diff options
author | Kleber Sacilotto de Souza <klebers@linux.vnet.ibm.com> | 2013-02-22 14:58:02 (GMT) |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-02-28 13:38:41 (GMT) |
commit | 1707248f45ca2be86156c9ee2bf3dc34a9d55c8a (patch) | |
tree | 9d39512d0162550da5e93ab242ca9d5707a02dc0 /drivers/net/ethernet/mellanox | |
parent | 46983ccad157df0e6dfa910b5255de6ddee35f04 (diff) | |
download | linux-fsl-qoriq-1707248f45ca2be86156c9ee2bf3dc34a9d55c8a.tar.xz |
mlx4_en: fix allocation of device tx_cq
[ Upstream commit 427a96252d8eee7b9bbafce15bd37fa3387ede55 ]
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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/net/ethernet/mellanox')
-rw-r--r-- | drivers/net/ethernet/mellanox/mlx4/en_netdev.c | 2 |
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 75a3f46..b54d60c 100644 --- a/drivers/net/ethernet/mellanox/mlx4/en_netdev.c +++ b/drivers/net/ethernet/mellanox/mlx4/en_netdev.c @@ -1597,7 +1597,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; |