netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Howells <dhowells@redhat.com>
To: Arnd Bergmann <arnd@arndb.de>
Cc: dhowells@redhat.com, "David S. Miller" <davem@davemloft.net>,
	netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] rxrpc: fix uninitialized variable use
Date: Tue, 21 Jun 2016 09:48:52 +0100	[thread overview]
Message-ID: <3356.1466498932@warthog.procyon.org.uk> (raw)
In-Reply-To: <20160617095555.1696781-1-arnd@arndb.de>

Arnd Bergmann <arnd@arndb.de> wrote:

> Hashing the peer key was introduced for AF_INET, but gcc
> warns about the rxrpc_peer_hash_key function returning uninitialized
> data for any other value of srx->transport.family:
> 
> net/rxrpc/peer_object.c: In function 'rxrpc_peer_hash_key':
> net/rxrpc/peer_object.c:57:15: error: 'p' may be used uninitialized in this function [-Werror=maybe-uninitialized]
> 
> Assuming that nothing else can be set here, this changes the
> function to just return zero in case of an unknown address
> family.

I'm actually more tempted to put a BUG() in there because if any new family
support (say AF_INET6) is added, I want to make sure I catch all the places.

David

  reply	other threads:[~2016-06-21  8:48 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-17  9:55 [PATCH] rxrpc: fix uninitialized variable use Arnd Bergmann
2016-06-21  8:48 ` David Howells [this message]
2016-06-21  9:28   ` Arnd Bergmann
2016-06-21 10:05     ` David Howells

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=3356.1466498932@warthog.procyon.org.uk \
    --to=dhowells@redhat.com \
    --cc=arnd@arndb.de \
    --cc=davem@davemloft.net \
    --cc=linux-kernel@vger.kernel.org \
    --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 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).