summaryrefslogtreecommitdiff
path: root/Kconfig
diff options
context:
space:
mode:
authorArnd Bergmann <arnd@arndb.de>2016-11-10 17:44:46 +0100
committerLinus Torvalds <torvalds@linux-foundation.org>2016-11-11 08:45:08 -0800
commit3a6d867612dce2035ca50cb02e7871d27c86aa72 (patch)
tree6babb572b78290f960434e47b6341ccec30dc05a /Kconfig
parente84efa32b9d2763fb92e73c8942100d8f55ad4ed (diff)
x86: apm: avoid uninitialized data
apm_bios_call() can fail, and return a status in its argument structure. If that status however is zero during a call from apm_get_power_status(), we end up using data that may have never been set, as reported by "gcc -Wmaybe-uninitialized": arch/x86/kernel/apm_32.c: In function ‘apm’: arch/x86/kernel/apm_32.c:1729:17: error: ‘bx’ may be used uninitialized in this function [-Werror=maybe-uninitialized] arch/x86/kernel/apm_32.c:1835:5: error: ‘cx’ may be used uninitialized in this function [-Werror=maybe-uninitialized] arch/x86/kernel/apm_32.c:1730:17: note: ‘cx’ was declared here arch/x86/kernel/apm_32.c:1842:27: error: ‘dx’ may be used uninitialized in this function [-Werror=maybe-uninitialized] arch/x86/kernel/apm_32.c:1731:17: note: ‘dx’ was declared here This changes the function to return "APM_NO_ERROR" here, which makes the code more robust to broken BIOS versions, and avoids the warning. Signed-off-by: Arnd Bergmann <arnd@arndb.de> Reviewed-by: Jiri Kosina <jkosina@suse.cz> Reviewed-by: Luis R. Rodriguez <mcgrof@kernel.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'Kconfig')
0 files changed, 0 insertions, 0 deletions