Skip to content

Commit

Permalink
UBIFS: fix error path in create_default_filesystem()
Browse files Browse the repository at this point in the history
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: hujianyang <[email protected]>
Signed-off-by: Artem Bityutskiy <[email protected]>
  • Loading branch information
hujianyang authored and dedekind committed Jul 19, 2014
1 parent f2b6521 commit 6dcfb80
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions fs/ubifs/sb.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 6dcfb80

Please sign in to comment.