RDMA/core: Fix double put of resource
PATCH 1/1 RDMA/core: Fix double put of resource
From: Maor Gottlieb <[email protected]>
Avoid decrease reference count of resource tracker object in the error flow of res_get_common_doit.
Fixes c5dfe0ea6ffa ("RDMA/nldev: Add resource tracker doit callback")
Signed-off-by Maor Gottlieb <[email protected]>
Signed-off-by Leon Romanovsky <[email protected]>
--- drivers/infiniband/core/nldev.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/infiniband/core/nldev.c +1 -2
@@ -1292,11 +1292,10 @@ static int res_get_common_doit(struct sk_buff *skb, struct nlmsghdr *nlh, has_cap_net_admin =netlink_capable (skb,CAP_NET_ADMIN ); ret =fill_func (msg, has_cap_net_admin, res, port); - -rdma_restrack_put (res);if (ret) goto err_free; +rdma_restrack_put (res);nlmsg_end (msg, nlh);ib_device_put (device);return rdma_nl_unicast (sock_net (skb->sk), msg,NETLINK_CB (skb).portid);
Signature · 1 line
2.26.2
Jason Gunthorpe
AppliedQuoted 11 lines · Leon Romanovsky
From: Maor Gottlieb <[email protected]>
Avoid decrease reference count of resource tracker object in the error flow of
res_get_common_doit.Fixes c5dfe0ea6ffa ("RDMA/nldev: Add resource tracker doit callback")Signed-off-by Maor Gottlieb <[email protected]>Signed-off-by Leon Romanovsky <[email protected]>--- drivers/infiniband/core/nldev.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
Applied to for-rc, thanks
Jason