net/bnxt: fix memory leaks in NVM commands
authorAjit Khaparde <ajit.khaparde@broadcom.com>
Thu, 26 Jul 2018 01:15:45 +0000 (18:15 -0700)
committerThomas Monjalon <thomas@monjalon.net>
Thu, 2 Aug 2018 10:05:25 +0000 (12:05 +0200)
commit6621ae146166adaba8dc4c120ad8c0fabab95830
treea621e88edeeb956cd3957567994ec7ea7d7f2c06
parenteae0a36249acb365c9c5952b0ed7f1d4b625ab42
net/bnxt: fix memory leaks in NVM commands

In some cases we may not be freeing up memory allocated for certain
NVM commands because the code might have bailed out before reaching
rte_free(). This patch moves some code around to ensure the allocated
memory is freed before exiting the function.

Fixes: 19e6af01bb36 ("net/bnxt: support get/set EEPROM")
Cc: stable@dpdk.org
Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Reviewed-by: Somnath Kotur <somnath.kotur@broadcom.com>
Reviewed-by: Ray Jui <ray.jui@broadcom.com>
Reviewed-by: Michael Wildt <michael.wildt@broadcom.com>
Reviewed-by: Randy Schacher <stuart.schacher@broadcom.com>
drivers/net/bnxt/bnxt_hwrm.c