iavf: fix QoS capabilities memory leak

Commit 4c1a457cb8 ("iavf: add support to exchange qos capabilities")
allocates adapter->qos_caps during probe, but iavf_remove() does not
free it. This leaks the allocation whenever an iavf device is removed.

Free adapter->qos_caps in iavf_remove().

Fixes: 4c1a457cb8 ("iavf: add support to exchange qos capabilities")
Cc: [email protected]
Reviewed-by: Jedrzej Jagielski <[email protected]>
Signed-off-by: Xuanqiang Luo <[email protected]>
Reviewed-by: Aleksandr Loktionov <[email protected]>
Signed-off-by: Tony Nguyen <[email protected]>
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Jakub Kicinski <[email protected]>
This commit is contained in:
Xuanqiang Luo
2026-11-18 17:49:42 -08:00
committed by Jakub Kicinski
parent e3916fa03f
commit 65f6ffb900
@@ -5638,6 +5638,7 @@ static void iavf_remove(struct pci_dev *pdev)
iounmap(hw->hw_addr);
pci_release_regions(pdev);
kfree(adapter->vf_res);
kfree(adapter->qos_caps);
spin_lock_bh(&adapter->mac_vlan_list_lock);
/* If we got removed before an up/down sequence, we've got a filter
* hanging out there that we need to get rid of.