]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
bnxt_en: Fix coredump logic to free allocated buffer
authorShruti Parab <shruti.parab@broadcom.com>
Mon, 28 Apr 2025 22:59:01 +0000 (15:59 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 9 May 2025 07:44:01 +0000 (09:44 +0200)
commit3facfd720055fcbf256ecdefc592fecd1f84601e
tree8d1889959ec6226ac89f1fcfb0554a185848351a
parente0272844995aff8cbf2cc88b78c2b35ca51eda43
bnxt_en: Fix coredump logic to free allocated buffer

[ Upstream commit ea9376cf68230e05492f22ca45d329f16e262c7b ]

When handling HWRM_DBG_COREDUMP_LIST FW command in
bnxt_hwrm_dbg_dma_data(), the allocated buffer info->dest_buf is
not freed in the error path.  In the normal path, info->dest_buf
is assigned to coredump->data and it will eventually be freed after
the coredump is collected.

Free info->dest_buf immediately inside bnxt_hwrm_dbg_dma_data() in
the error path.

Fixes: c74751f4c392 ("bnxt_en: Return error if FW returns more data than dump length")
Reported-by: Michael Chan <michael.chan@broadcom.com>
Reviewed-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Signed-off-by: Shruti Parab <shruti.parab@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/ethernet/broadcom/bnxt/bnxt_coredump.c