]> git.proxmox.com Git - mirror_ubuntu-eoan-kernel.git/commitdiff
pkt_sched: Fix warning false positives.
authorDavid S. Miller <davem@davemloft.net>
Thu, 27 Sep 2012 22:35:47 +0000 (18:35 -0400)
committerDavid S. Miller <davem@davemloft.net>
Thu, 27 Sep 2012 22:35:47 +0000 (18:35 -0400)
GCC refuses to recognize that all error control flows do in fact
set err to something.

Add an explicit initialization to shut it up.

net/sched/sch_drr.c: In function ‘drr_enqueue’:
net/sched/sch_drr.c:359:11: warning: ‘err’ may be used uninitialized in this function [-Wmaybe-uninitialized]
net/sched/sch_qfq.c: In function ‘qfq_enqueue’:
net/sched/sch_qfq.c:885:11: warning: ‘err’ may be used uninitialized in this function [-Wmaybe-uninitialized]

Signed-off-by: David S. Miller <davem@davemloft.net>
net/sched/sch_drr.c
net/sched/sch_qfq.c

index 9ce0b4fe23ffcb95db43bd11f0f45fe1f4edf65f..71e50c80315fe00437461f59aee17a2b5b2b09b1 100644 (file)
@@ -352,7 +352,7 @@ static int drr_enqueue(struct sk_buff *skb, struct Qdisc *sch)
 {
        struct drr_sched *q = qdisc_priv(sch);
        struct drr_class *cl;
-       int err;
+       int err = 0;
 
        cl = drr_classify(skb, sch, &err);
        if (cl == NULL) {
index e4723d31fdd56d6a46b2519afd19d612c7336749..25566208f12b91e2cbbd8b4ad08c78b2f4d632e9 100644 (file)
@@ -878,7 +878,7 @@ static int qfq_enqueue(struct sk_buff *skb, struct Qdisc *sch)
 {
        struct qfq_sched *q = qdisc_priv(sch);
        struct qfq_class *cl;
-       int err;
+       int err = 0;
 
        cl = qfq_classify(skb, sch, &err);
        if (cl == NULL) {