platform/x86: samsung-laptop: Initialize loca variable
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Wed, 7 Jun 2017 13:56:15 +0000 (16:56 +0300)
committerBen Hutchings <ben@decadent.org.uk>
Sat, 11 Nov 2017 13:34:46 +0000 (13:34 +0000)
commit 0d2c95354a3b63256e92d9fb865c08902d2c9b0b upstream.

The variable is used uninitialized which might come into unexpected
behaviour on some Samsung laptops.

Initialize it to 0xffff which seems a proper value for non-supported
feature.

Reported-by: Geert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
[bwh: Backported to 3.2: adjust context]
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
drivers/platform/x86/samsung-laptop.c

index 64e1f2d..7ec43a5 100644 (file)
@@ -601,7 +601,7 @@ static int __init samsung_init(void)
        struct sabi_retval sretval;
        unsigned int ifaceP;
        int i;
-       int loca;
+       int loca = 0xffff;
        int retval;
 
        if (efi_enabled(EFI_BOOT))