On Wed, Jun 18, 2025 at 07:27:16PM +0530, Subbaraya Sundeep wrote:
rvu_mbox_init function makes use of error path for
freeing memory which are local to the function in
both success and failure conditions. This is unusual hence
fix it by returning zero on success. With new cn20k code this
is freeing valid memory in success case also.
Fixes: e53ee4acb220 ("octeontx2-af: CN20k basic mbox operations and structures")
Signed-off-by: Subbaraya Sundeep <sbhatta@marvell.com>
Reviewed-by: Simon Horman <horms@kernel.org>
Although I don't think the problem is introduced by this patch
with it applied Smatch notices that the following code, around line 2528,
which jumps to free_regions does so with err uninitialised. This is a
problem because the jump will result in the function returning err.
switch (type) {
case TYPE_AFPF
...
default:
goto free_regions;
}
...