All of lore.kernel.org
 help / color / mirror / Atom feed
From: David Miller <davem@davemloft.net>
To: jon.maloy@ericsson.com
Cc: netdev@vger.kernel.org, gordan.mihaljevic@dektech.com.au,
	tung.q.nguyen@dektech.com.au, hoang.h.le@dektech.com.au,
	canh.d.luu@dektech.com.au, ying.xue@windriver.com,
	tipc-discussion@lists.sourceforge.net
Subject: Re: [net 1/1] tipc: tipc clang warning
Date: Sat, 23 Mar 2019 21:46:19 -0400 (EDT)	[thread overview]
Message-ID: <20190323.214619.673138376627603694.davem@davemloft.net> (raw)
In-Reply-To: <1553263431-22966-1-git-send-email-jon.maloy@ericsson.com>

From: Jon Maloy <jon.maloy@ericsson.com>
Date: Fri, 22 Mar 2019 15:03:51 +0100

> When checking the code with clang -Wsometimes-uninitialized we get the
> following warning:
> 
> if (!tipc_link_is_establishing(l)) {
>     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> net/tipc/node.c:847:46: note: uninitialized use occurs here
>       tipc_bearer_xmit(n->net, bearer_id, &xmitq, maddr);
> 
> net/tipc/node.c:831:2: note: remove the 'if' if its condition is always
> true
> if (!tipc_link_is_establishing(l)) {
>     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> net/tipc/node.c:821:31: note: initialize the variable 'maddr' to silence
> this warning
> struct tipc_media_addr *maddr;
> 
> We fix this by initializing 'maddr' to NULL. For the matter of clarity,
> we also test if 'xmitq' is non-empty before we use it and 'maddr'
> further down in the  function. It will never happen that 'xmitq' is non-
> empty at the same time as 'maddr' is NULL, so this is a sufficient test.
> 
> Fixes: 598411d70f85 ("tipc: make resetting of links non-atomic")
> Reported-by: Nathan Chancellor <natechancellor@gmail.com>
> Signed-off-by: Jon Maloy <jon.maloy@ericsson.com>

Applied.

      reply	other threads:[~2019-03-24  1:46 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-22 14:03 [net 1/1] tipc: tipc clang warning Jon Maloy
2019-03-24  1:46 ` David Miller [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=20190323.214619.673138376627603694.davem@davemloft.net \
    --to=davem@davemloft.net \
    --cc=canh.d.luu@dektech.com.au \
    --cc=gordan.mihaljevic@dektech.com.au \
    --cc=hoang.h.le@dektech.com.au \
    --cc=jon.maloy@ericsson.com \
    --cc=netdev@vger.kernel.org \
    --cc=tipc-discussion@lists.sourceforge.net \
    --cc=tung.q.nguyen@dektech.com.au \
    --cc=ying.xue@windriver.com \
    /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.