Re: [PATCH net 1/2] net: cls_u32: fix error code for invalid flags
On 16-06-06 08:16 AM, Jakub Kicinski wrote: > 'err' variable is not set in this test, we would return whatever > previous test set 'err' to. > > Signed-off-by: Jakub Kicinski> --- > net/sched/cls_u32.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/net/sched/cls_u32.c b/net/sched/cls_u32.c > index 079b43b3c5d2..b17e090f2fe1 100644 > --- a/net/sched/cls_u32.c > +++ b/net/sched/cls_u32.c > @@ -863,7 +863,7 @@ static int u32_change(struct net *net, struct sk_buff > *in_skb, > if (tb[TCA_U32_FLAGS]) { > flags = nla_get_u32(tb[TCA_U32_FLAGS]); > if (!tc_flags_valid(flags)) > - return err; > + return -EINVAL; > } > > n = (struct tc_u_knode *)*arg; > Yep, I agree it is nice to get an error on this case. Acked-by: John Fastabend
Re: [PATCH net 1/2] net: cls_u32: fix error code for invalid flags
On 6/6/2016 8:16 AM, Jakub Kicinski wrote: 'err' variable is not set in this test, we would return whatever previous test set 'err' to. Signed-off-by: Jakub KicinskiAcked-by: Sridhar Samudrala --- net/sched/cls_u32.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/sched/cls_u32.c b/net/sched/cls_u32.c index 079b43b3c5d2..b17e090f2fe1 100644 --- a/net/sched/cls_u32.c +++ b/net/sched/cls_u32.c @@ -863,7 +863,7 @@ static int u32_change(struct net *net, struct sk_buff *in_skb, if (tb[TCA_U32_FLAGS]) { flags = nla_get_u32(tb[TCA_U32_FLAGS]); if (!tc_flags_valid(flags)) - return err; + return -EINVAL; } n = (struct tc_u_knode *)*arg;
[PATCH net 1/2] net: cls_u32: fix error code for invalid flags
'err' variable is not set in this test, we would return whatever previous test set 'err' to. Signed-off-by: Jakub Kicinski--- net/sched/cls_u32.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/sched/cls_u32.c b/net/sched/cls_u32.c index 079b43b3c5d2..b17e090f2fe1 100644 --- a/net/sched/cls_u32.c +++ b/net/sched/cls_u32.c @@ -863,7 +863,7 @@ static int u32_change(struct net *net, struct sk_buff *in_skb, if (tb[TCA_U32_FLAGS]) { flags = nla_get_u32(tb[TCA_U32_FLAGS]); if (!tc_flags_valid(flags)) - return err; + return -EINVAL; } n = (struct tc_u_knode *)*arg; -- 1.9.1