mlx5: fix possible crash during initialization
authorOr Ami <ora@mellanox.com>
Thu, 3 Mar 2016 14:27:34 +0000 (15:27 +0100)
committerThomas Monjalon <thomas.monjalon@6wind.com>
Wed, 16 Mar 2016 17:52:17 +0000 (18:52 +0100)
RSS configuration should not be freed when priv is NULL.

Fixes: 2f97422e7759 ("mlx5: support RSS hash update and get")

Signed-off-by: Or Ami <ora@mellanox.com>
doc/guides/rel_notes/release_16_04.rst
drivers/net/mlx5/mlx5.c

index b6f99a7..41207c1 100644 (file)
@@ -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,
index 575420e..41dcbbf 100644 (file)
@@ -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)