DPDK patches and discussions
 help / color / mirror / Atom feed
* [PATCH] net/mlx5: fix segfault on close after failed start
@ 2021-11-23 20:22 Dmitry Kozlyuk
  2021-11-23 22:39 ` Raslan Darawsheh
  0 siblings, 1 reply; 2+ messages in thread
From: Dmitry Kozlyuk @ 2021-11-23 20:22 UTC (permalink / raw)
  To: dev; +Cc: Raslan Darawsheh, xuemingl, Matan Azrad, Viacheslav Ovsiienko

If mlx5_rxq_start() failed and rxq_ctrl was not initialized,
mlx5_rxq_obj_verify() would segfaul in an attempt to dereference it.
Add a check that rxq_ctrl is not NULL before accessing its members.

Fixes: 09c2555303be ("net/mlx5: support shared Rx queue")
Cc: xuemingl@nvidia.com

Signed-off-by: Dmitry Kozlyuk <dkozlyuk@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
 drivers/net/mlx5/mlx5_rxq.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/net/mlx5/mlx5_rxq.c b/drivers/net/mlx5/mlx5_rxq.c
index 480f4f9f07..dd15e158b4 100644
--- a/drivers/net/mlx5/mlx5_rxq.c
+++ b/drivers/net/mlx5/mlx5_rxq.c
@@ -1271,6 +1271,8 @@ mlx5_rxq_obj_verify(struct rte_eth_dev *dev)
 	struct mlx5_rxq_obj *rxq_obj;
 	LIST_FOREACH(rxq_obj, &priv->rxqsobj, next) {
+		if (rxq_obj->rxq_ctrl == NULL)
+			continue;
 		if (rxq_obj->rxq_ctrl->rxq.shared &&

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-11-23 22:39 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-23 20:22 [PATCH] net/mlx5: fix segfault on close after failed start Dmitry Kozlyuk
2021-11-23 22:39 ` Raslan Darawsheh

DPDK patches and discussions

This inbox may be cloned and mirrored by anyone:

	git clone --mirror http://inbox.dpdk.org/dev/0 dev/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 dev dev/ http://inbox.dpdk.org/dev \
	public-inbox-index dev

Example config snippet for mirrors.
Newsgroup available over NNTP:

AGPL code for this site: git clone https://public-inbox.org/public-inbox.git