Skip to content

Commit 50bbe3d

Browse files
Maor Gottliebjgunthorpe
authored andcommitted
RDMA/core: Fix double put of resource
Do not decrease the reference count of resource tracker object twice in the error flow of res_get_common_doit. Fixes: c5dfe0e ("RDMA/nldev: Add resource tracker doit callback") Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Maor Gottlieb <[email protected]> Signed-off-by: Leon Romanovsky <[email protected]> Signed-off-by: Jason Gunthorpe <[email protected]>
1 parent 1901b91 commit 50bbe3d

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

drivers/infiniband/core/nldev.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1292,11 +1292,10 @@ static int res_get_common_doit(struct sk_buff *skb, struct nlmsghdr *nlh,
12921292
has_cap_net_admin = netlink_capable(skb, CAP_NET_ADMIN);
12931293

12941294
ret = fill_func(msg, has_cap_net_admin, res, port);
1295-
1296-
rdma_restrack_put(res);
12971295
if (ret)
12981296
goto err_free;
12991297

1298+
rdma_restrack_put(res);
13001299
nlmsg_end(msg, nlh);
13011300
ib_device_put(device);
13021301
return rdma_nl_unicast(sock_net(skb->sk), msg, NETLINK_CB(skb).portid);

0 commit comments

Comments
 (0)