netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Charles <18oliveira.charles@gmail.com>
To: "David S. Miller" <davem@davemloft.net>,
	Alexey Kuznetsov <kuznet@ms2.inr.ac.ru>,
	Hideaki YOSHIFUJI <yoshfuji@linux-ipv6.org>
Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
	rodrigosiqueiramelo@gmail.com
Subject: [PATCH] net: ipva: fix uninitialized variable warning
Date: Thu, 13 Jun 2019 14:28:41 -0300	[thread overview]
Message-ID: <20190613172841.s4ig3p53wpd2z3nb@debie> (raw)

Avoid following compiler warning on uninitialized variable

net/ipv4/fib_semantics.c: In function ‘fib_check_nh_v4_gw’:
net/ipv4/fib_semantics.c:1023:12: warning: ‘err’ may be used
uninitialized in this function [-Wmaybe-uninitialized]
   if (!tbl || err) {

Signed-off-by: Charles Oliveira <18oliveira.charles@gmail.com>
---
 net/ipv4/fib_semantics.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/ipv4/fib_semantics.c b/net/ipv4/fib_semantics.c
index b80410673915..ae47e046695c 100644
--- a/net/ipv4/fib_semantics.c
+++ b/net/ipv4/fib_semantics.c
@@ -964,7 +964,7 @@ static int fib_check_nh_v4_gw(struct net *net, struct fib_nh *nh, u32 table,
 {
 	struct net_device *dev;
 	struct fib_result res;
-	int err;
+	int err = -EINVAL;
 
 	if (nh->fib_nh_flags & RTNH_F_ONLINK) {
 		unsigned int addr_type;
-- 
2.11.0


             reply	other threads:[~2019-06-13 17:29 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-13 17:28 Charles [this message]
2019-06-15 20:36 ` [PATCH] net: ipva: fix uninitialized variable warning David Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190613172841.s4ig3p53wpd2z3nb@debie \
    --to=18oliveira.charles@gmail.com \
    --cc=davem@davemloft.net \
    --cc=kuznet@ms2.inr.ac.ru \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=rodrigosiqueiramelo@gmail.com \
    --cc=yoshfuji@linux-ipv6.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).