projects
/
linux-block.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
ab80e71
)
rtnetlink: fix error code in rtnl_newlink()
author
Dan Carpenter
<dan.carpenter@linaro.org>
Fri, 6 Dec 2024 12:32:52 +0000
(15:32 +0300)
committer
Jakub Kicinski
<kuba@kernel.org>
Sun, 8 Dec 2024 02:25:09 +0000
(18:25 -0800)
If rtnl_get_peer_net() fails, then propagate the error code. Don't
return success.
Fixes:
48327566769a
("rtnetlink: fix double call of rtnl_link_get_net_ifla()")
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
Reviewed-by: Kuniyuki Iwashima <kuniyu@amazon.com>
Link:
https://patch.msgid.link/a2d20cd4-387a-4475-887c-bb7d0e88e25a@stanley.mountain
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
net/core/rtnetlink.c
patch
|
blob
|
blame
|
history
diff --git
a/net/core/rtnetlink.c
b/net/core/rtnetlink.c
index ab5f201bf0ab41b463175f501e8560b4d64d9b0a..ebcfc2debf1a3d5de1f4bc42dd748c20f07b680e 100644
(file)
--- a/
net/core/rtnetlink.c
+++ b/
net/core/rtnetlink.c
@@
-3972,8
+3972,10
@@
static int rtnl_newlink(struct sk_buff *skb, struct nlmsghdr *nlh,
if (ops->peer_type) {
peer_net = rtnl_get_peer_net(ops, data, extack);
- if (IS_ERR(peer_net))
+ if (IS_ERR(peer_net)) {
+ ret = PTR_ERR(peer_net);
goto put_ops;
+ }
if (peer_net)
rtnl_nets_add(&rtnl_nets, peer_net);
}