diff mbox series

[net-next] octeontx2-af: Fix a double free issue

Message ID 20231218180258.303468-1-sumang@marvell.com (mailing list archive)
State Accepted
Commit 27c346a22f816b1d02e9303c572b4b8e31b75f98
Delegated to: Netdev Maintainers
Headers show
Series [net-next] octeontx2-af: Fix a double free issue | expand

Checks

Context Check Description
netdev/series_format success Single patches do not need cover letters
netdev/tree_selection success Clearly marked for net-next
netdev/ynl success Generated files up to date; no warnings/errors; no diff in generated;
netdev/fixes_present success Fixes tag not required for -next series
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 8 this patch: 8
netdev/cc_maintainers success CCed 11 of 11 maintainers
netdev/build_clang fail Errors and warnings before: 12 this patch: 12
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/deprecated_api success None detected
netdev/check_selftest success No net selftest shell script
netdev/verify_fixes success Fixes tag looks correct
netdev/build_allmodconfig_warn success Errors and warnings before: 1142 this patch: 1142
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 8 lines checked
netdev/build_clang_rust success No Rust files in patch. Skipping build
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0

Commit Message

Suman Ghosh Dec. 18, 2023, 6:02 p.m. UTC
There was a memory leak during error handling in function
npc_mcam_rsrcs_init().

Fixes: dd7842878633 ("octeontx2-af: Add new devlink param to configure maximum usable NIX block LFs")
Suggested-by: Simon Horman <horms@kernel.org>
Signed-off-by: Suman Ghosh <sumang@marvell.com>
---
This is a follow-up of
https://urldefense.proofpoint.com/v2/url?u=https-3A__git.kernel.org_netdev_net-2Dnext_c_dd7842878633&d=DwIDaQ&c=nKjWec2b6R0mOyPaz7xtfQ&r=7si3Xn9Ly-Se1a655kvEPIYU0nQ9HPeN280sEUv5ROU&m=60aBCTsbI2Wra6po5SgIjqyAuIFqF5EhovKncvmmGaMwU94GDPEB2f_wC_piT9AE&s=7z2Gk48pbPhPqKU-pUu2xd2k6Ze5niLKk3P0iBiD9F8&e=

 drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Simon Horman Dec. 18, 2023, 7:10 p.m. UTC | #1
On Mon, Dec 18, 2023 at 11:32:58PM +0530, Suman Ghosh wrote:
> There was a memory leak during error handling in function
> npc_mcam_rsrcs_init().
> 
> Fixes: dd7842878633 ("octeontx2-af: Add new devlink param to configure maximum usable NIX block LFs")
> Suggested-by: Simon Horman <horms@kernel.org>
> Signed-off-by: Suman Ghosh <sumang@marvell.com>

Hi Suman,

thanks for the quick fix.

Reviewed-by: Simon Horman <horms@kernel.org>
patchwork-bot+netdevbpf@kernel.org Dec. 22, 2023, 1:40 p.m. UTC | #2
Hello:

This patch was applied to netdev/net-next.git (main)
by David S. Miller <davem@davemloft.net>:

On Mon, 18 Dec 2023 23:32:58 +0530 you wrote:
> There was a memory leak during error handling in function
> npc_mcam_rsrcs_init().
> 
> Fixes: dd7842878633 ("octeontx2-af: Add new devlink param to configure maximum usable NIX block LFs")
> Suggested-by: Simon Horman <horms@kernel.org>
> Signed-off-by: Suman Ghosh <sumang@marvell.com>
> 
> [...]

Here is the summary with links:
  - [net-next] octeontx2-af: Fix a double free issue
    https://git.kernel.org/netdev/net-next/c/27c346a22f81

You are awesome, thank you!
diff mbox series

Patch

diff --git a/drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c b/drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c
index 513c4fe86967..7f30e08b580f 100644
--- a/drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c
+++ b/drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c
@@ -1990,7 +1990,7 @@  int npc_mcam_rsrcs_init(struct rvu *rvu, int blkaddr)
 free_bmap_reverse:
 	kfree(mcam->bmap_reverse);
 free_bmap:
-	kfree(mcam->counters.bmap);
+	kfree(mcam->bmap);
 
 	return -ENOMEM;
 }