diff options
author | Wei Yongjun <yongjun_wei@trendmicro.com.cn> | 2016-06-17 17:34:17 (GMT) |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2016-06-25 21:41:18 (GMT) |
commit | b3e6916d6edfdf12505efbfb4a019e8a96f2c674 (patch) | |
tree | 4445b9e09fc52df074a2f8f7e44ee5425eb7e7e8 /drivers/staging/wilc1000 | |
parent | 4562d224edbe62e5620abbf49ffa8ceae2b73762 (diff) | |
download | linux-b3e6916d6edfdf12505efbfb4a019e8a96f2c674.tar.xz |
staging: wilc1000: fix return value check in wlan_initialize_threads()
In case of error, the function kthread_run() returns ERR_PTR()
and never returns NULL. The NULL test in the return value check
should be replaced with IS_ERR().
Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Reviewed-by: Julian Calaby <julian.calaby@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/wilc1000')
-rw-r--r-- | drivers/staging/wilc1000/linux_wlan.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/staging/wilc1000/linux_wlan.c b/drivers/staging/wilc1000/linux_wlan.c index 2ce9df5..3a66255 100644 --- a/drivers/staging/wilc1000/linux_wlan.c +++ b/drivers/staging/wilc1000/linux_wlan.c @@ -715,10 +715,10 @@ static int wlan_initialize_threads(struct net_device *dev) wilc->txq_thread = kthread_run(linux_wlan_txq_task, (void *)dev, "K_TXQ_TASK"); - if (!wilc->txq_thread) { + if (IS_ERR(wilc->txq_thread)) { netdev_err(dev, "couldn't create TXQ thread\n"); wilc->close = 0; - return -ENOBUFS; + return PTR_ERR(wilc->txq_thread); } wait_for_completion(&wilc->txq_thread_started); |