Skip to contentSkip to conversation

Platform: Fix error path in samsung-laptop init

PATCH New David Herrmann 1 participant 1 message Aug 23, 2011

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Platform: Fix error path in samsung-laptop init

samsung_init() should not return success if not all devices are initialized. Otherwise, samsung_exit() will dereference sdev NULL pointers and others.

---
 drivers/platform/x86/samsung-laptop.c |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)
drivers/platform/x86/samsung-laptop.c +1 -2
index 3591630..376ca89 100644
@@ -770,7 +770,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);
@@ -821,7 +821,6 @@ static int __init samsung_init(void)
 	if (retval)
 		goto error_file_create;
 
-exit:
 	return 0;
 
 error_file_create:
Signature · 1 line
1.7.6