From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751600AbcFUJ1n (ORCPT ); Tue, 21 Jun 2016 05:27:43 -0400 Received: from mout.kundenserver.de ([212.227.126.187]:62772 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750905AbcFUJ1g (ORCPT ); Tue, 21 Jun 2016 05:27:36 -0400 From: Arnd Bergmann To: David Howells Cc: "David S. Miller" , 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 Message-ID: <6563611.x9M4D6kWiH@wuerfel> User-Agent: KMail/5.1.3 (Linux/4.4.0-22-generic; KDE/5.18.0; x86_64; ; ) In-Reply-To: <3356.1466498932@warthog.procyon.org.uk> References: <20160617095555.1696781-1-arnd@arndb.de> <3356.1466498932@warthog.procyon.org.uk> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Provags-ID: V03:K0:xJnhEA7PMlZQNbw5pqDFr3+3eEbw19ZQcPZXif3OjmYU9Px0xHd +2RoDlPZ/HDfCkDNOyR3zHjSKkl/ivqz44Ara8APyFHJ/ju2YzXzZSrGUy2RpH2ub5dobdK wyT3cVqOZ6nMzpX7co/7nUge4DkO3T2RNxIdv1FXLAoF3pDeOPmneBKGZWQ2yK+lyNKo84I OoqW20Pee4u1ucqhj06cA== X-UI-Out-Filterresults: notjunk:1;V01:K0:AkFxLlMW5LE=:pwLjrcBwF9ynoJNVu0ufyL e+RsSgJ1nR4I0poEWD2j354SkiyFarRJRNvYiICxCafrtbiz1CXam1UbaDlJYq6yXCfNfbe9Z cxEIZVWxCyg2FdSLFu3iztPEEcETFC0FrjyCTjH5t162KiKDA8rKGrYyEvSOvFAqg0z79k5Nt w7/p81Sc7Lx+OSz01KKsADFMgqlhQRPHzwg19jXCijjWo9lFu/4kjHTFzHB5Mz0cTwkB4bKEi XadPZjCamH2UBABJvLOzwXUnoUEyGawti6yFWbPknUs8CCAP3CGgsxfeFGFPQ6EqlAmOKxzES P2F8JYXu+wW//qSpgV24zQRZ3gqXjST02/bu40kaPvOKgovy5BtauhLUsRpU7ItAzCc+AO9Qj J1EVUBCZ5m0VJC/ikCuC1tNz/yVA16PlINOkpgqeALth6eAP0xnNHz91tw456dRJ53vygT58Y hb+qBGifnk7bPBahI6wyGPFqT68Kq8rsxmo3i1elLvI2J/qVV7iLF0E3wIo/E4pjXk55olUBQ pfnkG+SHZ0wrKlH/ytRtP9UtYgyymgN1uprSb3boNlJykLUfsDEcru+xztMIm2ymGjCtfJuvl sKO9Df6LZpINdan3ldWh/ptCM8bsXWsA3J4nrcc2+76hKo+PgpFsw+AIrf03iSAnIs722dvw9 HZp5VqR9g9k4uo8bDfGxjXZSp0JW9TXrp0E1euJUZvht/gd526aU2ys0rlW0d8y5kGKeRn7CR TSTMrPfY3FYrvhOH Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tuesday, June 21, 2016 9:48:52 AM CEST David Howells wrote: > 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. 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