Re: [PATCH] qlcnic: fix a memory leak in qlcnic_sriov_set_guest_vlan_mode()

From: Paolo Abeni
Date: Tue Mar 04 2025 - 06:29:07 EST



On 2/28/25 10:24 AM, Haoxiang Li wrote:
> Add qlcnic_sriov_free_vlans() to free the memory allocated by
> qlcnic_sriov_alloc_vlans() if "sriov->allowed_vlans" fails to
> be allocated.
>
> Fixes: 91b7282b613d ("qlcnic: Support VLAN id config.")
> Cc: stable@xxxxxxxxxxxxxxx
> Signed-off-by: Haoxiang Li <haoxiang_li2024@xxxxxxx>

AFAICS the fix is not complete: sriov vlans could still be leaked when
qlcnic_sriov_alloc_vlans() fails on any VF with id > 0.

Please handle even such scenario.

Thanks!

Paolo