From 2f636ae565262bc2ced51d9f58d3b9431a8edee0 Mon Sep 17 00:00:00 2001 From: Or Ami Date: Thu, 3 Mar 2016 15:27:34 +0100 Subject: [PATCH] mlx5: fix possible crash during initialization RSS configuration should not be freed when priv is NULL. Fixes: 2f97422e7759 ("mlx5: support RSS hash update and get") Signed-off-by: Or Ami --- doc/guides/rel_notes/release_16_04.rst | 4 ++++ drivers/net/mlx5/mlx5.c | 6 ++++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/doc/guides/rel_notes/release_16_04.rst b/doc/guides/rel_notes/release_16_04.rst index b6f99a7f07..41207c18de 100644 --- a/doc/guides/rel_notes/release_16_04.rst +++ b/doc/guides/rel_notes/release_16_04.rst @@ -274,6 +274,10 @@ Drivers under stress with traffic, which might result in application launch failure. +* **mlx5: Fixed possible crash during initialization.** + + A crash could occur when failing to allocate private device context. + * **aesni_mb: Fixed wrong return value when creating a device.** cryptodev_aesni_mb_init() was returning the device id of the device created, diff --git a/drivers/net/mlx5/mlx5.c b/drivers/net/mlx5/mlx5.c index 575420eeb0..41dcbbf697 100644 --- a/drivers/net/mlx5/mlx5.c +++ b/drivers/net/mlx5/mlx5.c @@ -497,8 +497,10 @@ mlx5_pci_devinit(struct rte_pci_driver *pci_drv, struct rte_pci_device *pci_dev) continue; port_error: - rte_free(priv->rss_conf); - rte_free(priv); + if (priv) { + rte_free(priv->rss_conf); + rte_free(priv); + } if (pd) claim_zero(ibv_dealloc_pd(pd)); if (ctx) -- 2.20.1