Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932346Ab3DCTwi (ORCPT ); Wed, 3 Apr 2013 15:52:38 -0400 Received: from dkim2.fusionio.com ([66.114.96.54]:51679 "EHLO dkim2.fusionio.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756543Ab3DCTwg (ORCPT ); Wed, 3 Apr 2013 15:52:36 -0400 X-ASG-Debug-ID: 1365018755-03d6a5139537280001-xx1T2L X-Barracuda-Envelope-From: JAxboe@fusionio.com Date: Wed, 3 Apr 2013 21:52:26 +0200 From: Jens Axboe To: Arnd Bergmann CC: "linux-kernel@vger.kernel.org" Subject: Re: [PATCH] block: avoid using uninitialized value in from queue_var_store Message-ID: <20130403195226.GC4667@kernel.dk> X-ASG-Orig-Subj: Re: [PATCH] block: avoid using uninitialized value in from queue_var_store References: <201304031530.52712.arnd@arndb.de> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <201304031530.52712.arnd@arndb.de> X-Barracuda-Connect: mail1.int.fusionio.com[10.101.1.21] X-Barracuda-Start-Time: 1365018755 X-Barracuda-Encrypted: AES128-SHA X-Barracuda-URL: http://10.101.1.180:8000/cgi-mod/mark.cgi X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=9.0 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.2.127084 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 872 Lines: 22 On Wed, Apr 03 2013, Arnd Bergmann wrote: > As found by gcc-4.8, the QUEUE_SYSFS_BIT_FNS macro creates functions > that use a value generated by queue_var_store independent of whether > that value was set or not. > > block/blk-sysfs.c: In function 'queue_store_nonrot': > block/blk-sysfs.c:244:385: warning: 'val' may be used uninitialized in this function [-Wmaybe-uninitialized] > > Unlike most other such warnings, this one is not a false positive, > writing any non-number string into the sysfs files indeed has > an undefined result, rather than returning an error. Huh indeed, thanks Arnd. Queued up. -- Jens Axboe -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/