diff options
author | hujianyang <hujianyang@huawei.com> | 2014-06-10 22:38:45 -0400 |
---|---|---|
committer | Artem Bityutskiy <artem.bityutskiy@linux.intel.com> | 2014-07-19 02:53:52 -0400 |
commit | 6dcfb80264be6f83240450428ead88cacadef2cd (patch) | |
tree | 63d696b24eb5fab100066cf8ff8e9740ee31f246 /fs/ubifs/sb.c | |
parent | f2b6521aa11771e87f7357f1d5ceff8165fa0585 (diff) |
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: hujianyang <hujianyang@huawei.com>
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
Diffstat (limited to 'fs/ubifs/sb.c')
-rw-r--r-- | fs/ubifs/sb.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/fs/ubifs/sb.c b/fs/ubifs/sb.c index c2c3d13efa1c..79c6dbbc0e04 100644 --- a/fs/ubifs/sb.c +++ b/fs/ubifs/sb.c | |||
@@ -332,6 +332,8 @@ static int create_default_filesystem(struct ubifs_info *c) | |||
332 | cs->ch.node_type = UBIFS_CS_NODE; | 332 | cs->ch.node_type = UBIFS_CS_NODE; |
333 | err = ubifs_write_node(c, cs, UBIFS_CS_NODE_SZ, UBIFS_LOG_LNUM, 0); | 333 | err = ubifs_write_node(c, cs, UBIFS_CS_NODE_SZ, UBIFS_LOG_LNUM, 0); |
334 | kfree(cs); | 334 | kfree(cs); |
335 | if (err) | ||
336 | return err; | ||
335 | 337 | ||
336 | ubifs_msg("default file-system created"); | 338 | ubifs_msg("default file-system created"); |
337 | return 0; | 339 | return 0; |