diff options
| author | Ariel Ehrenberg <aehrenberg@nvidia.com> | 2026-07-22 22:03:40 +0000 |
|---|---|---|
| committer | Konstantin Belousov <kib@FreeBSD.org> | 2026-08-03 20:38:47 +0000 |
| commit | 9f071039ca34801fee7727106e23b824e98ed4a9 (patch) | |
| tree | f5e1e45d96123f61b7fd19585f517f5d16066863 | |
| parent | 4bd01d6ae01632501b63438b8d9a401db9744a78 (diff) | |
sys/ofed: fix GID table reference leak in roce_gid_update_addr_callback()
The "add missing GIDs" loop uses rdma_find_gid_by_port() to test whether
a GID already exists, but forgets to drop the reference it returns. So
every rescan that finds an existing GID leaks one, which pins the entry
and prevents its slot from ever being freed on delete.
Just release the reference once the GID is found, like the "remove stale
GIDs" loop already does.
Reported by: Wafa Hamzah <wafah@nvidia.com>
Reviewed by: kib, jhb
Sponsored by: Nvidia networking
Fixes: 6a75471dbcf0 ("OFED: Various changes from Linux 4.19")
Differential revision: https://reviews.freebsd.org/D58511
| -rw-r--r-- | sys/ofed/drivers/infiniband/core/ib_roce_gid_mgmt.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/sys/ofed/drivers/infiniband/core/ib_roce_gid_mgmt.c b/sys/ofed/drivers/infiniband/core/ib_roce_gid_mgmt.c index e346f477d719..e24a6645e8e4 100644 --- a/sys/ofed/drivers/infiniband/core/ib_roce_gid_mgmt.c +++ b/sys/ofed/drivers/infiniband/core/ib_roce_gid_mgmt.c @@ -260,8 +260,10 @@ roce_gid_update_addr_callback(struct ib_device *device, u8 port, /* check if entry found */ sgid_attr = rdma_find_gid_by_port(device, &gid, i, port, entry->ndev); - if (!IS_ERR(sgid_attr)) + if (!IS_ERR(sgid_attr)) { + rdma_put_gid_attr(sgid_attr); break; + } } if (i != IB_GID_TYPE_SIZE) continue; |
