Skip to contentSkip to conversation

net/mlx4: fix verbs cmd fd leak in the secondary process

PATCH New [email protected] 1 participant 2 messages Jul 6, 2022 Network drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 net/mlx4: fix verbs cmd fd leak in the secondary process

From: Long Li <[email protected]>

FDs passed from rte_mp_msg are duplicated to the secondary process and need to be closed.

Fixes 0203d33a10 ("net/mlx4: support secondary process")
---
 drivers/net/mlx4/mlx4_txq.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/net/mlx4/mlx4_txq.c +2 -0
index 0db2e55bef..bf7e036e19 100644
@@ -146,6 +146,7 @@ mlx4_tx_uar_init_secondary(struct rte_eth_dev *dev, int fd)
 		if (ret)
 			goto error;
 	}
+	close(fd);
 	return 0;
 error:
 	/* Rollback. */
@@ -155,6 +156,7 @@ mlx4_tx_uar_init_secondary(struct rte_eth_dev *dev, int fd)
 			continue;
 		txq_uar_uninit_secondary(txq);
 	} while (i--);
+	close(fd);
 	return -rte_errno;
 }
 
Signature · 1 line
2.17.1
#1 lore raw

PATCH 1/1 net/mlx5: fix verbs fd leak in the secondary process

From: Long Li <[email protected]>

FDs passed from rte_mp_msg are duplicated to the secondary process and need to be closed.

Fixes 9a8ab29b84 ("net/mlx5: replace IPC socket with EAL API")
---
 drivers/net/mlx5/mlx5_txq.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/net/mlx5/mlx5_txq.c +2 -0
index 4e0bf7af9c..df55a4cd25 100644
@@ -636,6 +636,7 @@ mlx5_tx_uar_init_secondary(struct rte_eth_dev *dev, int fd)
 		if (ret)
 			goto error;
 	}
+	close(fd);
 	return 0;
 error:
 	/* Rollback. */
@@ -646,6 +647,7 @@ mlx5_tx_uar_init_secondary(struct rte_eth_dev *dev, int fd)
 		txq_ctrl = container_of(txq, struct mlx5_txq_ctrl, txq);
 		txq_uar_uninit_secondary(txq_ctrl);
 	} while (i--);
+	close(fd);
 	return -rte_errno;
 }
 
Signature · 1 line
2.17.1