Merge branch 'for-upstream' of git://openrisc.net/jonas/linux
[pandora-kernel.git] / drivers / mtd / ubi / build.c
index 6d0d483..6c3fb5a 100644 (file)
@@ -1019,6 +1019,8 @@ int ubi_attach_mtd_dev(struct mtd_info *mtd, int ubi_num, int vid_hdr_offset)
 out_debugfs:
        ubi_debugfs_exit_dev(ubi);
 out_uif:
+       get_device(&ubi->dev);
+       ubi_assert(ref);
        uif_close(ubi);
 out_detach:
        ubi_wl_close(ubi);