From: Arnd Bergmann <arnd@arndb.de>
To: David Howells <dhowells@redhat.com>
Cc: "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 11:28:53 +0200 [thread overview]
Message-ID: <6563611.x9M4D6kWiH@wuerfel> (raw)
In-Reply-To: <3356.1466498932@warthog.procyon.org.uk>
On Tuesday, June 21, 2016 9:48:52 AM CEST David Howells wrote:
> 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.
Makes sense. Do you want to do the patch yourself, or should I send
a new one doing that?
Maybe WARN() would be better than BUG()? That would still get the attention
it needs but not kill the process.
Arnd
next prev parent reply other threads:[~2016-06-21 9:27 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
2016-06-21 9:28 ` Arnd Bergmann [this message]
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=6563611.x9M4D6kWiH@wuerfel \
--to=arnd@arndb.de \
--cc=davem@davemloft.net \
--cc=dhowells@redhat.com \
--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).