net/bnxt: fix lock release on NVM write failure
authorAjit Khaparde <ajit.khaparde@broadcom.com>
Thu, 26 Jul 2018 01:15:46 +0000 (18:15 -0700)
committerThomas Monjalon <thomas@monjalon.net>
Thu, 2 Aug 2018 10:12:47 +0000 (12:12 +0200)
commit4623c0d4b572e9bea28d59e6e54ae6d5dab2412e
treea152c29569ce4f2878b26aab9e28bd25f4e3f699
parent6621ae146166adaba8dc4c120ad8c0fabab95830
net/bnxt: fix lock release on NVM write failure

In bnxt_hwrm_flash_nvram, before attempting to allocate a buffer
we are grabbing the rte_spinlock. And if the allocation fails we
are returning before releasing the spinlock. We avoid the situation
by calling HWRM_PREP which grabs the lock after the buffer is
allocated successfully.

Fixes: 19e6af01bb36 ("net/bnxt: support get/set EEPROM")
Cc: stable@dpdk.org
Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Reviewed-by: Randy Schacher <stuart.schacher@broadcom.com>
drivers/net/bnxt/bnxt_hwrm.c