From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752066AbbKYKHe (ORCPT ); Wed, 25 Nov 2015 05:07:34 -0500 Received: from mout.kundenserver.de ([217.72.192.74]:61982 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751928AbbKYKH3 (ORCPT ); Wed, 25 Nov 2015 05:07:29 -0500 From: Arnd Bergmann To: gregkh@linuxfoundation.org Cc: Jiri Slaby , linux-serial@vger.kernel.org, linux-kernel@vger.kernel.org, Chen Jun , channing , Russ Gorby , Vasiliy Kulikov Subject: Re: [PATCH] serial: ifx6x60: avoid uninitialized variable use Date: Wed, 25 Nov 2015 11:07 +0100 Message-ID: <6445070.Vs3hNH0JSm@wuerfel> User-Agent: KMail/4.11.5 (Linux/3.16.0-10-generic; KDE/4.11.5; x86_64; ; ) In-Reply-To: <3244991.qANsXoqoKs@wuerfel> References: <3244991.qANsXoqoKs@wuerfel> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Provags-ID: V03:K0:C8uGNh+6fIHE9yMP6+Nz/ef5QnbtHdFp6GZo3laFinbB9QvHbAl bIa5sdRyahte06uw8iqnh56p5y23VGGgBDbphXJElJJtrHBectr87IPNohuPVHvfuoolWdo cFn/X/Cx1eZ/LMmJF6ODgdFO1/4Z2RhdYINv4WM+8qt9OhO7fSl8bx9Li1QpPnifSIuQ4K1 9XXUU4Xb6/Uv6QcstLLkA== X-UI-Out-Filterresults: notjunk:1;V01:K0:Jt3zxKBSoo8=:nzo0/ruzj1YbnuvNz7M5Wq 6LhtTjoNEz9HA3HZdl/hLNlKTO4jfVdZe0P3qDKF1nXojNfm9UqC5u5QX++AIMg1y6qiqLrDK 22GTQ1roqquW0d4hNTYkf9u47rXUJna9TD59c40EMe2ivmUeNUEtu3ctSb/A8S4lXP//R04aH +3Rib5HtPRGTyA1I0R+mWA3IZWkL+FOQD1tDcDVnfjMm2Enuus/J1W2WxF060orsfAvyUbVnY kTMHGOWFbQKVM3r8tEO3w7tdcVQ+Kd419CxeFZ65NL7jUjVN1ZT6uiPO5meXNWl5eX0RnbV9j TWqlpYP41bhCapfp1klqEzRAZyfQOxE7VdlBQgC8cmjV90mO7gkbMci/PNQWmrLDAR3mjudEx yBzCqzzkJXErdqvANUg6+aFp9FnvnkYpIRIoFt83e4u5CK14QbyjQEXUi9AjoTXqqBwFWd64x 2yuX1kNMNFT8A63/oAp61+RgxhmlqX5iUBaEOCcpwLapfrkif5iNfvaWiFpyIOgHk23BvqsvZ Ae70aUnr+g2kr95Jsf4es1/MhnFzOQd1YuPn9nDZAfrp62eeF2/VyG2+Ez6GSe3SAexDffTB6 KOeho5XNa17JLgkoqgqTWCLpvu1ppggM+tL0v6xPNFv82FD4K8QDl+2wl0zT0trzWRxmQDXKE oaJndx097ASOtOxd7RnAHRKpHoKh3uMTIXAITch5lMYUnzwN79IQ3f/KcMLbhWGuQwypvliVX a7dVltB6WCRajULF Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tuesday 24 November 2015 23:04:00 Arnd Bergmann wrote: > gcc warns about a potential use of an uninitialized variable in this driver: > > drivers/tty/serial/ifx6x60.c: In function 'ifx_spi_complete': > drivers/tty/serial/ifx6x60.c:713:6: warning: 'more' may be used uninitialized in this function [-Wmaybe-uninitialized] > if (more || ifx_dev->spi_more || queue_length > 0 || > > Unlike a lot of other such warnings, this one is correct and describes > an actual problem in the handling of the "IFX_SPI_HEADER_F" result code. > > This appears to be a result from a restructuring of the driver that > dates back to before it was merged in the kernel, so it's impossible > to know where it went wrong. I also don't know what that result code > means, so I have no idea if setting 'more' to zero is the correct > solution, but at least it makes the behavior reproducible rather than > depending on whatever happens to be on the kernel stack. > > Signed-off-by: Arnd Bergmann > --- > Cc everyone who contributed non-cleanup patches to this driver, > maybe someone has more insight into the operation of the driver than > I have and can comment on whether this is the right fix or not. Grmbl. Please don't apply this version for now. The patch fixes one issue and made the warning go away in some configurations, but my randconfig tests still show the same warning in other configurations, as there is a second way that the 'more' variable ends up being referenced without being initialized. Let's wait for comments first, but I assume we will have to initialize the 'more' variable as well, or possibly that function needs to be rewritten. Arnd