Re: [net-next PATCH] octeontx2-af: Fix rvu_mbox_init return path
From: Simon Horman <horms@kernel.org>
Date: 2025-06-20 20:00:17
On Fri, Jun 20, 2025 at 11:14:43AM +0000, Subbaraya Sundeep wrote:
On 2025-06-18 at 19:43:01, Simon Horman (horms@kernel.org) wrote:quoted
On Wed, Jun 18, 2025 at 07:27:16PM +0530, Subbaraya Sundeep wrote:quoted
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.Thanks Simon for review. I will send fix for Smatch error in separate patch later.
Excellent, thanks.