aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--mm/backing-dev.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/mm/backing-dev.c b/mm/backing-dev.c
index e5e0972bdd6f..164ccc93690f 100644
--- a/mm/backing-dev.c
+++ b/mm/backing-dev.c
@@ -961,6 +961,8 @@ static void release_bdi(struct kref *ref)
struct backing_dev_info *bdi =
container_of(ref, struct backing_dev_info, refcnt);
+ if (test_bit(WB_registered, &bdi->wb.state))
+ bdi_unregister(bdi);
bdi_exit(bdi);
kfree(bdi);
}