[PATCH] staging: ft1000: Check return value of kthread_run.

From: Marek Belisko
Date: Wed Nov 10 2010 - 03:27:35 EST


kthread_run could fail so we will check return value.

Signed-off-by: Marek Belisko <marek.belisko@xxxxxxxxx>
---
drivers/staging/ft1000/ft1000-usb/ft1000_usb.c | 6 ++++++
1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/drivers/staging/ft1000/ft1000-usb/ft1000_usb.c b/drivers/staging/ft1000/ft1000-usb/ft1000_usb.c
index 41bbe99..dcbc97c 100644
--- a/drivers/staging/ft1000/ft1000-usb/ft1000_usb.c
+++ b/drivers/staging/ft1000/ft1000-usb/ft1000_usb.c
@@ -175,6 +175,12 @@ static int ft1000_probe(struct usb_interface *interface,
gPollingfailed = FALSE;
pft1000info->pPollThread =
kthread_run(ft1000_poll_thread, ft1000dev, "ft1000_poll");
+
+ if (IS_ERR(pft1000info->pPollThread)) {
+ ret = PTR_ERR(pft1000info->pPollThread);
+ goto err_load;
+ }
+
msleep(500);

while (!pft1000info->CardReady) {
--
1.7.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/