net: cls_u32: fix error code for invalid flags
authorJakub Kicinski <jakub.kicinski@netronome.com>
Mon, 6 Jun 2016 15:16:47 +0000 (16:16 +0100)
committerDavid S. Miller <davem@davemloft.net>
Tue, 7 Jun 2016 23:27:14 +0000 (16:27 -0700)
'err' variable is not set in this test, we would return whatever
previous test set 'err' to.

Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com>
Acked-by: Sridhar Samudrala <sridhar.samudrala@intel.com>
Acked-by: John Fastabend <john.r.fastabend@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/sched/cls_u32.c

index 079b43b3c5d24dc5eaf7bc5e7b7d0d4d0c672ca2..b17e090f2fe14d519e11d346643178047005fc11 100644 (file)
@@ -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;