Re: [PATCH net] qlcnic: fix memory leak in qlcnic_sriov_channel_cfg_cmd()

From: Simon Horman
Date: Thu May 08 2025 - 13:37:13 EST


On Wed, May 07, 2025 at 08:51:00PM +0530, Abdun Nihaal wrote:
> In one of the error paths in qlcnic_sriov_channel_cfg_cmd(), the memory
> allocated in qlcnic_sriov_alloc_bc_mbx_args() for mailbox arguments is
> not freed. Fix that by jumping to the error path that frees them, by
> calling qlcnic_free_mbx_args().

Thanks, I agree with your analysis.

But I think it would be nice to include some text regarding
how you found the bug, e.g. by inspection, using static analysis,
via a crash.

And if you have been able to test the patch on hardware,
or if, rather, it is compile tested only.

>
> Fixes: f197a7aa6288 ("qlcnic: VF-PF communication channel implementation")
> Signed-off-by: Abdun Nihaal <abdun.nihaal@xxxxxxxxx>

...