lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Thu, 05 Jul 2012 09:56:50 -0600
From:	Stephen Warren <swarren@...dotorg.org>
To:	Thierry Reding <thierry.reding@...onic-design.de>
CC:	linux-kernel@...r.kernel.org, Stephen Warren <swarren@...dia.com>
Subject: Re: [PATCH] pwm: fix used-uninitialized warning in pwm_get()

On 07/03/2012 11:58 PM, Thierry Reding wrote:
> On Tue, Jul 03, 2012 at 02:34:21PM -0600, Stephen Warren wrote:
>> From: Stephen Warren <swarren@...dia.com>
>> 
>> This fixes: drivers/pwm/core.c: In function 'pwm_get': 
>> drivers/pwm/core.c:534:15: warning: 'index' may be used
>> uninitialized in this function
>> 
>> The addition to the if condition at end of the function isn't
>> strictly necessary to solve the warning, but does make it more
>> obvious that the initialization of "index" to a dummy value isn't
>> just hiding the problem.
> 
> Actually this seems to be a false positive, and one that I don't
> see (I use GCC 4.6.3). index will be initialized when chip is set
> in the loop. My guess is that GCC 4.6.3 actually notices while your
> version doesn't.

Yes, it is a false-positive, which is why I was fine with just
initializing the variable to hide the warning rather than making some
other code change. I think there's still value in hiding the warning
though, so that:

a) Nobody else has to look at the warning and decide it's a false
positive and remember to ignore it.

b) The fewer warnings there are, the more likely new warnings will be
noticed and analyzed.

So I'd still argue for this change, or some other fix for the warning,
be merged.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ