Platform: Fix error path in samsung-laptop init
authorDavid Herrmann <dh.herrmann@googlemail.com>
Tue, 20 Sep 2011 16:16:12 +0000 (09:16 -0700)
committerMatthew Garrett <mjg@redhat.com>
Mon, 24 Oct 2011 14:52:35 +0000 (16:52 +0200)
samsung_init() should not return success if not all devices are initialized.
Otherwise, samsung_exit() will dereference sdev NULL pointers and others.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
Cc: stable <stable@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Matthew Garrett <mjg@redhat.com>
drivers/platform/x86/samsung-laptop.c

index 7eb6733138e6da213b02263801a0fe9d95fddae3..4d3bed476d52642c270359788f6e408bdae549b2 100644 (file)
@@ -781,7 +781,7 @@ static int __init samsung_init(void)
        sabi_iface = ioremap_nocache(ifaceP, 16);
        if (!sabi_iface) {
                pr_err("Can't remap %x\n", ifaceP);
-               goto exit;
+               goto error_no_signature;
        }
        if (debug) {
                printk(KERN_DEBUG "ifaceP = 0x%08x\n", ifaceP);
@@ -833,7 +833,6 @@ static int __init samsung_init(void)
        if (retval)
                goto error_file_create;
 
-exit:
        return 0;
 
 error_file_create: