From patchwork Fri May 13 03:04:05 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Miller X-Patchwork-Id: 95418 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id ED6BEB6F08 for ; Fri, 13 May 2011 13:04:41 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753211Ab1EMDEW (ORCPT ); Thu, 12 May 2011 23:04:22 -0400 Received: from shards.monkeyblade.net ([198.137.202.13]:59921 "EHLO shards.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750703Ab1EMDEV (ORCPT ); Thu, 12 May 2011 23:04:21 -0400 Received: from localhost (cpe-66-108-115-211.nyc.res.rr.com [66.108.115.211]) (authenticated bits=0) by shards.monkeyblade.net (8.14.4/8.14.4) with ESMTP id p4D34674011509 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 12 May 2011 20:04:12 -0700 Date: Thu, 12 May 2011 23:04:05 -0400 (EDT) Message-Id: <20110512.230405.532264333967231887.davem@davemloft.net> To: sfr@canb.auug.org.au Cc: netdev@vger.kernel.org, linux-next@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: linux-next: build warning after merge of the net tree From: David Miller In-Reply-To: <20110513114139.b1ed88ae.sfr@canb.auug.org.au> References: <20110513114139.b1ed88ae.sfr@canb.auug.org.au> X-Mailer: Mew version 6.3 on Emacs 23.2 / Mule 6.0 (HANACHIRUSATO) Mime-Version: 1.0 X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.6 (shards.monkeyblade.net [198.137.202.13]); Thu, 12 May 2011 20:04:13 -0700 (PDT) Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Stephen Rothwell Date: Fri, 13 May 2011 11:41:39 +1000 > After merging the net tree, today's linux-next build (powerpc > ppc64_defconfig) produced this warning: > > net/ipv4/ip_forward.c: In function 'ip_forward': > net/ipv4/ip_forward.c:87: warning: 'iph' may be used uninitialized in this function > > Introduced by commit def57687e957 ("ipv4: Elide use of rt->rt_dst in > ip_forward()"). It may be a false positive, but it is not obvious how > iph is assigned before being used. My compiler didn't warn, (and I just double checked this) which is weird. Sigh. Thanks, here is the fix I'll push: -------------------- ipv4: Fix 'iph' use before set. I swear none of my compilers warned about this, yet it is so obvious. > net/ipv4/ip_forward.c: In function 'ip_forward': > net/ipv4/ip_forward.c:87: warning: 'iph' may be used uninitialized in this function Reported-by: Stephen Rothwell Signed-off-by: David S. Miller --- net/ipv4/ip_forward.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/net/ipv4/ip_forward.c b/net/ipv4/ip_forward.c index fcbc0c8..3b34d1c 100644 --- a/net/ipv4/ip_forward.c +++ b/net/ipv4/ip_forward.c @@ -84,7 +84,7 @@ int ip_forward(struct sk_buff *skb) rt = skb_rtable(skb); - if (opt->is_strictroute && iph->daddr != rt->rt_gateway) + if (opt->is_strictroute && ip_hdr(skb)->daddr != rt->rt_gateway) goto sr_failed; if (unlikely(skb->len > dst_mtu(&rt->dst) && !skb_is_gso(skb) &&