Skip to contentSkip to conversation

Staging: rtl8712: fix an error test in start_drv_threads()

PATCH New Dan Carpenter 1 participant 1 message Mar 5, 2014

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

PATCH 1/1 Staging: rtl8712: fix an error test in start_drv_threads()

Testing for "if (IS_ERR(padapter->cmdThread) < 0)" doesn't make sense. The kthread_run() function returns error pointers on error pointers on error so it should just be "if (IS_ERR(padapter->cmdThread))".

drivers/staging/rtl8712/os_intfs.c +1 -1
index 37fe33005c02..6bd08213cb70 100644
@@ -239,7 +239,7 @@ static u32 start_drv_threads(struct _adapter *padapter)
 {
 	padapter->cmdThread = kthread_run(r8712_cmd_thread, padapter, "%s",
 			      padapter->pnetdev->name);
-	if (IS_ERR(padapter->cmdThread) < 0)
+	if (IS_ERR(padapter->cmdThread))
 		return _FAIL;
 	return _SUCCESS;
 }