From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932596AbdKFXtt (ORCPT ); Mon, 6 Nov 2017 18:49:49 -0500 Received: from shadbolt.e.decadent.org.uk ([88.96.1.126]:51667 "EHLO shadbolt.e.decadent.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752780AbdKFXXf (ORCPT ); Mon, 6 Nov 2017 18:23:35 -0500 Content-Type: text/plain; charset="UTF-8" Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 From: Ben Hutchings To: linux-kernel@vger.kernel.org, stable@vger.kernel.org CC: akpm@linux-foundation.org, "David S. Miller" Date: Mon, 06 Nov 2017 23:03:07 +0000 Message-ID: X-Mailer: LinuxStableQueue (scripts by bwh) Subject: [PATCH 3.2 111/147] pkt_sched: Fix warning false positives. In-Reply-To: X-SA-Exim-Connect-IP: 2a02:8011:400e:2:6f00:88c8:c921:d332 X-SA-Exim-Mail-From: ben@decadent.org.uk X-SA-Exim-Scanned: No (on shadbolt.decadent.org.uk); SAEximRunCond expanded to false Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 3.2.95-rc1 review patch. If anyone has any objections, please let me know. ------------------ From: "David S. Miller" commit f54ba7798848ce1385a71b36a2c997422c82220a upstream. 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 [bwh: Backported to 3.2: adjust context] Signed-off-by: Ben Hutchings --- net/sched/sch_drr.c | 2 +- net/sched/sch_qfq.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) --- a/net/sched/sch_drr.c +++ b/net/sched/sch_drr.c @@ -351,7 +351,7 @@ static int drr_enqueue(struct sk_buff *s { 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) { --- a/net/sched/sch_qfq.c +++ b/net/sched/sch_qfq.c @@ -846,7 +846,7 @@ static int qfq_enqueue(struct sk_buff *s struct qfq_sched *q = qdisc_priv(sch); struct qfq_group *grp; struct qfq_class *cl; - int err; + int err = 0; u64 roundedS; int s;