OSDN Git Service

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)
committerDarren Hart (VMware) <dvhart@infradead.org>
Tue, 13 Jun 2017 18:00:16 +0000 (11:00 -0700)
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>
drivers/platform/x86/samsung-laptop.c

index 8c146e2..1aa1173 100644 (file)
@@ -1446,9 +1446,9 @@ static int __init samsung_sabi_init(struct samsung_laptop *samsung)
        const struct sabi_config *config = NULL;
        const struct sabi_commands *commands;
        unsigned int ifaceP;
+       int loca = 0xffff;
        int ret = 0;
        int i;
-       int loca;
 
        samsung->f0000_segment = ioremap_nocache(0xf0000, 0xffff);
        if (!samsung->f0000_segment) {