diff options
-rw-r--r-- | drivers/md/md.c | 2 | ||||
-rw-r--r-- | drivers/md/raid5.c | 3 |
2 files changed, 3 insertions, 2 deletions
diff --git a/drivers/md/md.c b/drivers/md/md.c index 117ea5fde568..f30f09cb08e8 100644 --- a/drivers/md/md.c +++ b/drivers/md/md.c | |||
@@ -5382,6 +5382,8 @@ mdk_thread_t *md_register_thread(void (*run) (mddev_t *), mddev_t *mddev, | |||
5382 | 5382 | ||
5383 | void md_unregister_thread(mdk_thread_t *thread) | 5383 | void md_unregister_thread(mdk_thread_t *thread) |
5384 | { | 5384 | { |
5385 | if (!thread) | ||
5386 | return; | ||
5385 | dprintk("interrupting MD-thread pid %d\n", task_pid_nr(thread->tsk)); | 5387 | dprintk("interrupting MD-thread pid %d\n", task_pid_nr(thread->tsk)); |
5386 | 5388 | ||
5387 | kthread_stop(thread->tsk); | 5389 | kthread_stop(thread->tsk); |
diff --git a/drivers/md/raid5.c b/drivers/md/raid5.c index d019a85547b4..81789fa7a023 100644 --- a/drivers/md/raid5.c +++ b/drivers/md/raid5.c | |||
@@ -4463,8 +4463,7 @@ static int run(mddev_t *mddev) | |||
4463 | 4463 | ||
4464 | return 0; | 4464 | return 0; |
4465 | abort: | 4465 | abort: |
4466 | if (mddev->thread) | 4466 | md_unregister_thread(mddev->thread); |
4467 | md_unregister_thread(mddev->thread); | ||
4468 | mddev->thread = NULL; | 4467 | mddev->thread = NULL; |
4469 | if (conf) { | 4468 | if (conf) { |
4470 | shrink_stripes(conf); | 4469 | shrink_stripes(conf); |