summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJiapeng Chong <jiapeng.chong@linux.alibaba.com>2021-06-02 18:15:04 +0800
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2021-06-18 09:59:00 +0200
commit107140952ecdd1946d8e9fcbb8f185ffc0b9f836 (patch)
tree130cec78e307637ff938d7d0bb2f84ada951b241
parent12fa0fdbcd0fb02b51d488f321439979eb72565b (diff)
downloadlinux-stable-107140952ecdd1946d8e9fcbb8f185ffc0b9f836.tar.gz
linux-stable-107140952ecdd1946d8e9fcbb8f185ffc0b9f836.tar.bz2
linux-stable-107140952ecdd1946d8e9fcbb8f185ffc0b9f836.zip
rtnetlink: Fix missing error code in rtnl_bridge_notify()
[ Upstream commit a8db57c1d285c758adc7fb43d6e2bad2554106e1 ] The error code is missing in this code scenario, add the error code '-EINVAL' to the return value 'err'. Eliminate the follow smatch warning: net/core/rtnetlink.c:4834 rtnl_bridge_notify() warn: missing error code 'err'. Reported-by: Abaci Robot <abaci@linux.alibaba.com> Signed-off-by: Jiapeng Chong <jiapeng.chong@linux.alibaba.com> Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Sasha Levin <sashal@kernel.org>
-rw-r--r--net/core/rtnetlink.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/net/core/rtnetlink.c b/net/core/rtnetlink.c
index 73c09b5864d7..bdeb169a7a99 100644
--- a/net/core/rtnetlink.c
+++ b/net/core/rtnetlink.c
@@ -4535,8 +4535,10 @@ static int rtnl_bridge_notify(struct net_device *dev)
if (err < 0)
goto errout;
- if (!skb->len)
+ if (!skb->len) {
+ err = -EINVAL;
goto errout;
+ }
rtnl_notify(skb, net, 0, RTNLGRP_LINK, NULL, GFP_ATOMIC);
return 0;