octeontx2-af: Fix a double free issue

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>
Reviewed-by: Simon Horman <horms@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
Suman Ghosh 2023-12-18 23:32:58 +05:30 committed by David S. Miller
parent afa9e26748
commit 27c346a22f

View File

@ -1990,7 +1990,7 @@ free_entry_map:
free_bmap_reverse:
kfree(mcam->bmap_reverse);
free_bmap:
kfree(mcam->counters.bmap);
kfree(mcam->bmap);
return -ENOMEM;
}