All of lore.kernel.org
 help / color / mirror / Atom feed
From: David Ahern <dsahern@gmail.com>
To: Koen Vandeputte <koen.vandeputte@ncentric.com>, netdev@vger.kernel.org
Subject: Re: Compiler warning - ipv4 fib_trie
Date: Mon, 4 Feb 2019 18:53:35 -0800	[thread overview]
Message-ID: <048e34cb-d920-60f5-7e52-ce3d2b4e00ae@gmail.com> (raw)
In-Reply-To: <ba46f918-243d-c106-6166-28caecdfd81d@ncentric.com>

On 2/4/19 3:55 AM, Koen Vandeputte wrote:
> Hi All,
> 
> During compilation of kernel 4.14.96 and 5.0-rc5 I'm seeing following
> warning:
> 
> net/ipv4/fib_trie.c: In function 'fib_trie_unmerge':
> net/ipv4/fib_trie.c:1749:8: warning: 'local_tp' may be used
> uninitialized in this function [-Wmaybe-uninitialized]
>     if (fib_insert_alias(lt, local_tp, local_l, new_fa,
>         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>            NULL, l->key)) {
>            ~~~~~~~~~~~~~
> 
> Code:
> 
> https://elixir.bootlin.com/linux/v5.0-rc5/source/net/ipv4/fib_trie.c#L1731
> 
> Looks like 'local_tp' should be NULL-ified
> 
> 
> Thanks,
> 
> Koen
> 

I believe that is a false positive. If you analyze the loop, local_tp is
set when local_l is NULL and it is set before the first use. I am
surprised the compiler can not track that. fib_find_node has 1 return
point and local_tp is set right before.

      reply	other threads:[~2019-02-05  2:53 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-02-04 11:55 Compiler warning - ipv4 fib_trie Koen Vandeputte
2019-02-05  2:53 ` David Ahern [this message]

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=048e34cb-d920-60f5-7e52-ce3d2b4e00ae@gmail.com \
    --to=dsahern@gmail.com \
    --cc=koen.vandeputte@ncentric.com \
    --cc=netdev@vger.kernel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.