]> git.baikalelectronics.ru Git - kernel.git/commit
rxrpc: fix uninitialized variable use
authorArnd Bergmann <arnd@arndb.de>
Fri, 17 Jun 2016 09:55:22 +0000 (11:55 +0200)
committerDavid Howells <dhowells@redhat.com>
Wed, 22 Jun 2016 08:09:58 +0000 (09:09 +0100)
commitf1a19ca48c066ac30dcc54d666cfe83edfc46c38
tree4e89c3d2c840cb134048b85f7531da716d806812
parent2969dd79134ec38719d65822ec8993dbdcc690dd
rxrpc: fix uninitialized variable use

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.

Fixes: b4cd416d3d31 ("rxrpc: Rework peer object handling to use hash table and RCU")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: David Howells <dhowells@redhat.com>
net/rxrpc/peer_object.c