diff options
author | NeilBrown <neilb@suse.de> | 2009-03-30 23:39:39 -0400 |
---|---|---|
committer | NeilBrown <neilb@suse.de> | 2009-03-30 23:39:39 -0400 |
commit | e0cf8f045b2023b0b3f919ee93eb94345f648434 (patch) | |
tree | 21d8d0741a5ae4676fea5b53939cc806ae2b41bd /drivers/md/md.c | |
parent | 91adb56473febeeb3ef657bb5147ddd355465700 (diff) |
md: md_unregister_thread should cope with being passed NULL
Mostly md_unregister_thread is only called when we know that the
thread is NULL, but sometimes we need to check first. It is safer
to put the check inside md_unregister_thread itself.
Signed-off-by: NeilBrown <neilb@suse.de>
Diffstat (limited to 'drivers/md/md.c')
-rw-r--r-- | drivers/md/md.c | 2 |
1 files changed, 2 insertions, 0 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); |