Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 6dcfb802 authored by hujianyang's avatar hujianyang Committed by Artem Bityutskiy
Browse files

UBIFS: fix error path in create_default_filesystem()



In the end of 'create_default_filesystem()' we need to check
the return value of 'ubifs_write_node()' to ensure that we have
successfully written the 'cs_node'.

Signed-off-by: default avatarhujianyang <hujianyang@huawei.com>
Signed-off-by: default avatarArtem Bityutskiy <artem.bityutskiy@linux.intel.com>
parent f2b6521a
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -332,6 +332,8 @@ static int create_default_filesystem(struct ubifs_info *c)
	cs->ch.node_type = UBIFS_CS_NODE;
	err = ubifs_write_node(c, cs, UBIFS_CS_NODE_SZ, UBIFS_LOG_LNUM, 0);
	kfree(cs);
	if (err)
		return err;

	ubifs_msg("default file-system created");
	return 0;