]> www.infradead.org Git - users/willy/pagecache.git/commit
qlcnic: fix memory leak issues in qlcnic_sriov_common.c
authorHaoxiang Li <haoxiang_li2024@163.com>
Fri, 7 Mar 2025 09:49:52 +0000 (17:49 +0800)
committerPaolo Abeni <pabeni@redhat.com>
Tue, 11 Mar 2025 14:23:28 +0000 (15:23 +0100)
commitd2b9d97e89c79c95f8b517e4fa43fd100f936acc
treee83a9a9a5bd55b483f117c6a162f80aabf8f92f2
parent415f135ace7fd824cde083184a922e39156055b5
qlcnic: fix memory leak issues in qlcnic_sriov_common.c

Add qlcnic_sriov_free_vlans() in qlcnic_sriov_alloc_vlans() if
any sriov_vlans fails to be allocated.
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@vger.kernel.org
Signed-off-by: Haoxiang Li <haoxiang_li2024@163.com>
Link: https://patch.msgid.link/20250307094952.14874-1-haoxiang_li2024@163.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
drivers/net/ethernet/qlogic/qlcnic/qlcnic_sriov_common.c