From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751689AbcFUI5e (ORCPT ); Tue, 21 Jun 2016 04:57:34 -0400 Received: from mx1.redhat.com ([209.132.183.28]:36183 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750707AbcFUI5c convert rfc822-to-8bit (ORCPT ); Tue, 21 Jun 2016 04:57:32 -0400 Organization: Red Hat UK Ltd. Registered Address: Red Hat UK Ltd, Amberley Place, 107-111 Peascod Street, Windsor, Berkshire, SI4 1TE, United Kingdom. Registered in England and Wales under Company Registration No. 3798903 From: David Howells In-Reply-To: <20160617095555.1696781-1-arnd@arndb.de> References: <20160617095555.1696781-1-arnd@arndb.de> To: Arnd Bergmann Cc: dhowells@redhat.com, "David S. Miller" , netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] rxrpc: fix uninitialized variable use MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <3355.1466498932.1@warthog.procyon.org.uk> Content-Transfer-Encoding: 8BIT Date: Tue, 21 Jun 2016 09:48:52 +0100 Message-ID: <3356.1466498932@warthog.procyon.org.uk> X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.27]); Tue, 21 Jun 2016 08:48:54 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Arnd Bergmann 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