diff --git a/drivers/md/bcache/super.c b/drivers/md/bcache/super.c index ca39cf20aa96d6986a49629f6d6911ea0950af89..be8054c04eb775ca1a2e92c2d12bb67ab41c89b6 100644 --- a/drivers/md/bcache/super.c +++ b/drivers/md/bcache/super.c @@ -1552,7 +1552,7 @@ static void cache_set_flush(struct closure *cl) kobject_put(&c->internal); kobject_del(&c->kobj); - if (c->gc_thread) + if (!IS_ERR_OR_NULL(c->gc_thread)) kthread_stop(c->gc_thread); if (!IS_ERR_OR_NULL(c->root))