Skip to content

Commit

Permalink
Handle kthread_create() failures properly in taskq_create().
Browse files Browse the repository at this point in the history
The return value should be checked with IS_ERR() to deal with
possible -ENOMEM or other errors.
  • Loading branch information
dweeezil committed Mar 26, 2014
1 parent 4c99541 commit 357e01a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion module/spl/spl-taskq.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 357e01a

Please sign in to comment.