bdi: Fix use after free bug in debugfs_remove()
[sfrench/cifs-2.6.git] / mm / backing-dev.c
index fa5e6d7406d19e0f4e363d8ee1c5321690f3ae34..7441bd93b732000f7405f191991b102eefc26832 100644 (file)
@@ -115,6 +115,7 @@ static int bdi_debug_register(struct backing_dev_info *bdi, const char *name)
                                               bdi, &bdi_debug_stats_fops);
        if (!bdi->debug_stats) {
                debugfs_remove(bdi->debug_dir);
+               bdi->debug_dir = NULL;
                return -ENOMEM;
        }