Skip to content

Commit

Permalink
netlink: Unset cb_running when terminating dump on release
Browse files Browse the repository at this point in the history
When we terminated the dump, the callback isn't running, so cb_running
should be set to false to be logically consistent.

cb_running signifies whether a dump is ongoing. It is set to true in
cb->start(), and is checked in netlink_dump() to be true initially.
After the dump, it is set to false in the same function.

This is just a cleanup, no path should access this field on a closed
socket.

Signed-off-by: Siddh Raman Pant <siddh.raman.pant@oracle.com>
Link: https://patch.msgid.link/aff028e3eb2b768b9895fa6349fa1981ae22f098.camel@oracle.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
  • Loading branch information
Siddh Raman Pant authored and Jakub Kicinski committed Feb 19, 2025
1 parent d5b595d commit 4389891
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions net/netlink/af_netlink.c
Original file line number Diff line number Diff line change
Expand Up @@ -771,6 +771,7 @@ static int netlink_release(struct socket *sock)
nlk->cb.done(&nlk->cb);
module_put(nlk->cb.module);
kfree_skb(nlk->cb.skb);
WRITE_ONCE(nlk->cb_running, false);
}

module_put(nlk->module);
Expand Down

0 comments on commit 4389891

Please sign in to comment.