net/bnxt: fix memory leak when mapping fails
authorYunjian Wang <wangyunjian@huawei.com>
Tue, 1 Dec 2020 00:59:34 +0000 (08:59 +0800)
committerFerruh Yigit <ferruh.yigit@intel.com>
Fri, 8 Jan 2021 15:03:04 +0000 (16:03 +0100)
commitb9f0ad21f856b1d577f3369421559582639e53cf
tree7eee03ed41dcaa22a45725dad7fd174d48e062ed
parent495b2ed40a39b2bc7c6c146535c511e983ae2b64
net/bnxt: fix memory leak when mapping fails

We allocated memory for the 'buf' when sending message to HWRM,
but we don't free it when mapping the address to IO address
fails. It will lead to memory leak.

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