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>
This commit is contained in:
NeilBrown
2009-03-31 14:39:39 +11:00
parent 91adb56473
commit e0cf8f045b
2 changed files with 3 additions and 2 deletions

View File

@@ -4463,8 +4463,7 @@ static int run(mddev_t *mddev)
return 0;
abort:
if (mddev->thread)
md_unregister_thread(mddev->thread);
md_unregister_thread(mddev->thread);
mddev->thread = NULL;
if (conf) {
shrink_stripes(conf);