From: Siddh Raman Pant Date: Sat, 15 Feb 2025 09:40:51 +0000 (+0000) Subject: netlink: Unset cb_running when terminating dump on release X-Git-Tag: io_uring-6.15-20250403~82^2~289 X-Git-Url: https://git.kernel.dk/?a=commitdiff_plain;h=438989137acd6c620e9990c24dead5ffdd8e77c1;p=linux-2.6-block.git netlink: Unset cb_running when terminating dump on release 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 Link: https://patch.msgid.link/aff028e3eb2b768b9895fa6349fa1981ae22f098.camel@oracle.com Signed-off-by: Jakub Kicinski --- diff --git a/net/netlink/af_netlink.c b/net/netlink/af_netlink.c index 85311226183a..f8f13058a46e 100644 --- a/net/netlink/af_netlink.c +++ b/net/netlink/af_netlink.c @@ -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);