瀏覽代碼

UBIFS: fix a memory leak on error path.

In 'mount_ubifs()', in case of 'ubifs_leb_unmap()' falure,
free allocated resources.

Signed-off-by: Matthieu CASTET <matthieu.castet@parrot.com>
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
Matthieu CASTET 15 年之前
父節點
當前提交
c18de72fb3
共有 1 個文件被更改,包括 1 次插入1 次删除
  1. 1 1
      fs/ubifs/super.c

+ 1 - 1
fs/ubifs/super.c

@@ -1320,7 +1320,7 @@ static int mount_ubifs(struct ubifs_info *c)
 			 */
 			 */
 			err = ubifs_leb_unmap(c, c->gc_lnum);
 			err = ubifs_leb_unmap(c, c->gc_lnum);
 			if (err)
 			if (err)
-				return err;
+				goto out_orphans;
 		}
 		}
 
 
 		err = dbg_check_lprops(c);
 		err = dbg_check_lprops(c);