]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
RDMA/hns: Fix dip entries leak on devices newer than hip09
authorJunxian Huang <huangjunxian6@hisilicon.com>
Tue, 12 Aug 2025 12:26:02 +0000 (20:26 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 28 Aug 2025 14:34:44 +0000 (16:34 +0200)
[ Upstream commit fa2e2d31ee3b7212079323b4b09201ef68af3a97 ]

DIP algorithm is also supported on devices newer than hip09, so free
dip entries too.

Fixes: f91696f2f053 ("RDMA/hns: Support congestion control type selection according to the FW")
Signed-off-by: Junxian Huang <huangjunxian6@hisilicon.com>
Link: https://patch.msgid.link/20250812122602.3524602-1-huangjunxian6@hisilicon.com
Signed-off-by: Leon Romanovsky <leon@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/infiniband/hw/hns/hns_roce_hw_v2.c

index 256757f0ff65cbd0ae7151305a529bf9d59a9104..b544ca0244842b19c48d25bc4927d9f2d7f8cbaf 100644 (file)
@@ -3043,7 +3043,7 @@ static void hns_roce_v2_exit(struct hns_roce_dev *hr_dev)
        if (!hr_dev->is_vf)
                hns_roce_free_link_table(hr_dev);
 
-       if (hr_dev->pci_dev->revision == PCI_REVISION_ID_HIP09)
+       if (hr_dev->pci_dev->revision >= PCI_REVISION_ID_HIP09)
                free_dip_entry(hr_dev);
 }