sch_dsmark: Fix uninitialized variable warning.
authorDavid S. Miller <davem@davemloft.net>
Wed, 17 May 2017 20:03:16 +0000 (16:03 -0400)
committerDavid S. Miller <davem@davemloft.net>
Wed, 17 May 2017 20:04:38 +0000 (16:04 -0400)
We still need to initialize err to -EINVAL for
the case where 'opt' is NULL in dsmark_init().

Fixes: 6529eaba33f0 ("net: sched: introduce tcf block infractructure")
Signed-off-by: David S. Miller <davem@davemloft.net>
net/sched/sch_dsmark.c

index ba45102cff940d0f194be59f1ade4b07db4a18a0..7ccdd825d34e401a209831c643511a70f3f3d2bb 100644 (file)
@@ -333,7 +333,7 @@ static int dsmark_init(struct Qdisc *sch, struct nlattr *opt)
 {
        struct dsmark_qdisc_data *p = qdisc_priv(sch);
        struct nlattr *tb[TCA_DSMARK_MAX + 1];
-       int err;
+       int err = -EINVAL;
        u32 default_index = NO_DEFAULT_INDEX;
        u16 indices;
        int i;