dm rq: check kthread_run return for .request_fn request-based DM
authorMike Snitzer <snitzer@redhat.com>
Wed, 6 Jul 2016 13:06:37 +0000 (09:06 -0400)
committerMike Snitzer <snitzer@redhat.com>
Wed, 6 Jul 2016 13:06:37 +0000 (09:06 -0400)
Check return value of kthread_run() in dm_old_init_request_queue().

Reported-by: Minfei Huang <mnghuan@gmail.com>
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
drivers/md/dm-rq.c

index 266f7b674108e1b010a58df78046484374269fb8..aa81539374a6ece785118d69c5839d69b4235ad0 100644 (file)
@@ -819,6 +819,8 @@ int dm_old_init_request_queue(struct mapped_device *md)
        init_kthread_worker(&md->kworker);
        md->kworker_task = kthread_run(kthread_worker_fn, &md->kworker,
                                       "kdmwork-%s", dm_device_name(md));
+       if (IS_ERR(md->kworker_task))
+               return PTR_ERR(md->kworker_task);
 
        elv_register_queue(md->queue);