From: Marek Belisko <marek.belisko@open-nandra.com>
Date: Thu, 9 Dec 2010 15:13:49 +0000 (+0100)
Subject: staging: ft1000: Use return value for ft1000InitProc.
X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=1c46282421c8b31b37323f7b007c4562ce17578c;p=GitHub%2Fexynos8895%2Fandroid_kernel_samsung_universal8895.git

staging: ft1000: Use return value for ft1000InitProc.

Add checking for return value ft1000InitProc and cleanup
if something fail.

Signed-off-by: Marek Belisko <marek.belisko@open-nandra.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---

diff --git a/drivers/staging/ft1000/ft1000-usb/ft1000_usb.c b/drivers/staging/ft1000/ft1000-usb/ft1000_usb.c
index 7dfed41b02ac..0e1fc3f1e055 100644
--- a/drivers/staging/ft1000/ft1000-usb/ft1000_usb.c
+++ b/drivers/staging/ft1000/ft1000-usb/ft1000_usb.c
@@ -198,12 +198,17 @@ static int ft1000_probe(struct usb_interface *interface,
 	if (ret)
 		goto err_thread;
 
-	pft1000info->NetDevRegDone = 1;
+	ret = ft1000InitProc(ft1000dev->net);
+	if (ret)
+		goto err_proc;
 
-	ft1000InitProc(ft1000dev->net);
+	pft1000info->NetDevRegDone = 1;
 
 	return 0;
 
+err_proc:
+	unregister_netdev(ft1000dev->net);
+	free_netdev(ft1000dev->net);
 err_thread:
 	kthread_stop(pft1000info->pPollThread);
 err_load: