mlx4_en: fix allocation of device tx_cq
Subsystems (4)
PATCH 1/1 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.
--- drivers/net/ethernet/mellanox/mlx4/en_netdev.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/net/ethernet/mellanox/mlx4/en_netdev.c +1 -1
@@ -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 ;
Signature · 1 line
1.7.1
Quoted 16 lines · Kleber Sacilotto de Souza
The memory to hold the network device
tx_cqis not being allocated with the correct size inmlx4_en_init_netdev(). It should useMAX_TX_RINGSinstead ofMAX_RX_RINGS. This can cause problems if the number of tx rings being used is greater thanMAX_RX_RINGS.Signed-off-by Kleber Sacilotto de Souza <[email protected]>--- drivers/net/ethernet/mellanox/mlx4/en_netdev.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)drivers/net/ethernet/mellanox/mlx4/en_netdev.c +0
-0
drivers/net/ethernet/mellanox/mlx4/en_netdev.c int mlx4_en_init_netdev(struct mlx4_en_dev *mdev, int port, · line 2073
Quoted 8 lines
drivers/net/ethernet/mellanox/mlx4/en_netdev.c +1
-1@@ -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 ;
(sorry for double posting - tried to send from my tablet in plain text without success).
From: Kleber Sacilotto de Souza <[email protected]>
Date: Fri, 22 Feb 2013 21:58:02 -0300
Quoted 6 lines
The memory to hold the network device
tx_cqis not being allocated with the correct size inmlx4_en_init_netdev(). It should useMAX_TX_RINGSinstead ofMAX_RX_RINGS. This can cause problems if the number of tx rings being used is greater thanMAX_RX_RINGS.Signed-off-by Kleber Sacilotto de Souza <[email protected]>
Applied.