From: Or Ami Date: Thu, 3 Mar 2016 14:27:34 +0000 (+0100) Subject: mlx5: fix possible crash during initialization X-Git-Tag: spdx-start~7303 X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=2f636ae565262bc2ced51d9f58d3b9431a8edee0;p=dpdk.git 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 --- 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)