DPDK patches and discussions
 help / color / mirror / Atom feed
* [PATCH] net/mvpp2: fix null dereference in vmwa release
@ 2023-11-04 10:28 Weiguo Li
  2023-11-12 15:26 ` Raslan Darawsheh
  0 siblings, 1 reply; 2+ messages in thread
From: Weiguo Li @ 2023-11-04 10:28 UTC (permalink / raw)
  To: ophirmu; +Cc: lironh, dev, stable

Pointer 'mrvl_cfg' is dereferenced and then compared to NULL.
Move dereference after NULL test to fix this issue.

Fixes: 7af10d29a4a0 ("net/mlx5/linux: refactor VLAN")
Cc: stable@dpdk.org

Signed-off-by: Weiguo Li <liweiguo@xencore.cn>
---
 drivers/net/mlx5/linux/mlx5_vlan_os.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/net/mlx5/linux/mlx5_vlan_os.c b/drivers/net/mlx5/linux/mlx5_vlan_os.c
index 81611a8d3f..391c9ce832 100644
--- a/drivers/net/mlx5/linux/mlx5_vlan_os.c
+++ b/drivers/net/mlx5/linux/mlx5_vlan_os.c
@@ -37,12 +37,13 @@ mlx5_vlan_vmwa_release(struct rte_eth_dev *dev,
 {
 	struct mlx5_priv *priv = dev->data->dev_private;
 	struct mlx5_nl_vlan_vmwa_context *vmwa = priv->vmwa_context;
-	struct mlx5_nl_vlan_dev *vlan_dev = &vmwa->vlan_dev[0];
+	struct mlx5_nl_vlan_dev *vlan_dev;
 
 	MLX5_ASSERT(vlan->created);
 	MLX5_ASSERT(priv->vmwa_context);
 	if (!vlan->created || !vmwa)
 		return;
+	vlan_dev = &vmwa->vlan_dev[0];
 	vlan->created = 0;
 	rte_spinlock_lock(&vmwa->sl);
 	MLX5_ASSERT(vlan_dev[vlan->tag].refcnt);
-- 
2.34.1


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

* RE: [PATCH] net/mvpp2: fix null dereference in vmwa release
  2023-11-04 10:28 [PATCH] net/mvpp2: fix null dereference in vmwa release Weiguo Li
@ 2023-11-12 15:26 ` Raslan Darawsheh
  0 siblings, 0 replies; 2+ messages in thread
From: Raslan Darawsheh @ 2023-11-12 15:26 UTC (permalink / raw)
  To: Weiguo Li, Ophir Munk; +Cc: lironh, dev, stable

Hi Weiguo,

> -----Original Message-----
> From: Weiguo Li <liweiguo@xencore.cn>
> Sent: Saturday, November 4, 2023 12:29 PM
> To: Ophir Munk <ophirmu@nvidia.com>
> Cc: lironh@marvell.com; dev@dpdk.org; stable@dpdk.org
> Subject: [PATCH] net/mvpp2: fix null dereference in vmwa release
> 
> Pointer 'mrvl_cfg' is dereferenced and then compared to NULL.
> Move dereference after NULL test to fix this issue.
> 
I think the commit log isn't relevant to the change really,
Can you kindly check that?

Kindest  regards
Raslan Darawsheh

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

end of thread, other threads:[~2023-11-12 15:26 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-11-04 10:28 [PATCH] net/mvpp2: fix null dereference in vmwa release Weiguo Li
2023-11-12 15:26 ` Raslan Darawsheh

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).