From 357e01a9f6784e1758159c65c8fd848578e018d2 Mon Sep 17 00:00:00 2001 From: Tim Chase Date: Wed, 26 Mar 2014 08:29:24 -0500 Subject: [PATCH] Handle kthread_create() failures properly in taskq_create(). The return value should be checked with IS_ERR() to deal with possible -ENOMEM or other errors. --- module/spl/spl-taskq.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/module/spl/spl-taskq.c b/module/spl/spl-taskq.c index 3605a0f3..437e531e 100644 --- a/module/spl/spl-taskq.c +++ b/module/spl/spl-taskq.c @@ -841,7 +841,7 @@ taskq_create(const char *name, int nthreads, pri_t pri, tqt->tqt_thread = kthread_create(taskq_thread, tqt, "%s/%d", name, i); - if (tqt->tqt_thread) { + if (!IS_ERR(tqt->tqt_thread)) { list_add(&tqt->tqt_thread_list, &tq->tq_thread_list); set_user_nice(tqt->tqt_thread, PRIO_TO_NICE(pri)); wake_up_process(tqt->tqt_thread);