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>
diff --git a/drivers/md/raid5.c b/drivers/md/raid5.c
index d019a85..81789fa 100644
--- a/drivers/md/raid5.c
+++ b/drivers/md/raid5.c
@@ -4463,8 +4463,7 @@
return 0;
abort:
- if (mddev->thread)
- md_unregister_thread(mddev->thread);
+ md_unregister_thread(mddev->thread);
mddev->thread = NULL;
if (conf) {
shrink_stripes(conf);