projects
/
linux-2.6-microblaze.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
7139970
)
rtnetlink: fix leak of SRCU struct in rtnl_link_register
author
Sabrina Dubroca
<sd@queasysnail.net>
Mon, 23 Mar 2026 15:19:43 +0000
(16:19 +0100)
committer
Jakub Kicinski
<kuba@kernel.org>
Wed, 25 Mar 2026 03:56:02 +0000
(20:56 -0700)
Commit
6b57ff21a310
("rtnetlink: Protect link_ops by mutex.") swapped
the EEXIST check with the init_srcu_struct, but didn't add cleanup of
the SRCU struct we just allocated in case of error.
Fixes:
6b57ff21a310
("rtnetlink: Protect link_ops by mutex.")
Signed-off-by: Sabrina Dubroca <sd@queasysnail.net>
Reviewed-by: Kuniyuki Iwashima <kuniyu@google.com>
Link:
https://patch.msgid.link/e77fe499f9a58c547b33b5212b3596dad417cec6.1774025341.git.sd@queasysnail.net
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
net/core/rtnetlink.c
patch
|
blob
|
history
diff --git
a/net/core/rtnetlink.c
b/net/core/rtnetlink.c
index
4a22786
..
fae8034
100644
(file)
--- a/
net/core/rtnetlink.c
+++ b/
net/core/rtnetlink.c
@@
-629,6
+629,9
@@
int rtnl_link_register(struct rtnl_link_ops *ops)
unlock:
mutex_unlock(&link_ops_mutex);
+ if (err)
+ cleanup_srcu_struct(&ops->srcu);
+
return err;
}
EXPORT_SYMBOL_GPL(rtnl_link_register);