Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 145b1718 authored by Wei Yongjun's avatar Wei Yongjun Committed by Amit Pundir
Browse files

UPSTREAM: fib_rules: fix error return code



commit adeb45cbb5057731ce9c47aad93756135d7947bf upstream.

Fix to return error code -EINVAL from the error handling
case instead of 0, as done elsewhere in this function.

Fixes: 622ec2c9d524 ("net: core: add UID to flows, rules, and routes")
Signed-off-by: default avatarWei Yongjun <weiyongjun1@huawei.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>

Change-Id: I969dffb6ae4daeb039fc1a479165d8ff28636eec
Fixes: ("UPSTREAM: net: core: add UID to flows, rules, and routes")
Signed-off-by: default avatarAmit Pundir <amit.pundir@linaro.org>
parent 841c0b7f
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -425,6 +425,7 @@ int fib_nl_newrule(struct sk_buff *skb, struct nlmsghdr *nlh)
	if (tb[FRA_TUN_ID])
		rule->tun_id = nla_get_be64(tb[FRA_TUN_ID]);

	err = -EINVAL;
	if (tb[FRA_L3MDEV]) {
#ifdef CONFIG_NET_L3_MASTER_DEV
		rule->l3mdev = nla_get_u8(tb[FRA_L3MDEV]);
@@ -446,7 +447,6 @@ int fib_nl_newrule(struct sk_buff *skb, struct nlmsghdr *nlh)
	else
		rule->suppress_ifgroup = -1;

	err = -EINVAL;
	if (tb[FRA_GOTO]) {
		if (rule->action != FR_ACT_GOTO)
			goto errout_free;
@@ -576,8 +576,10 @@ int fib_nl_delrule(struct sk_buff *skb, struct nlmsghdr *nlh)

	if (tb[FRA_UID_RANGE]) {
		range = nla_get_kuid_range(tb);
		if (!uid_range_set(&range))
		if (!uid_range_set(&range)) {
			err = -EINVAL;
			goto errout;
		}
	} else {
		range = fib_kuid_range_unset;
	}