diff options
Diffstat (limited to 'fs/jffs2')
-rw-r--r-- | fs/jffs2/write.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/fs/jffs2/write.c b/fs/jffs2/write.c index c9fe0ab3a329..1406f2ce20a7 100644 --- a/fs/jffs2/write.c +++ b/fs/jffs2/write.c | |||
@@ -173,6 +173,12 @@ struct jffs2_full_dnode *jffs2_write_dnode(struct jffs2_sb_info *c, struct jffs2 | |||
173 | flash_ofs |= REF_NORMAL; | 173 | flash_ofs |= REF_NORMAL; |
174 | } | 174 | } |
175 | fn->raw = jffs2_add_physical_node_ref(c, flash_ofs, PAD(sizeof(*ri)+datalen), f->inocache); | 175 | fn->raw = jffs2_add_physical_node_ref(c, flash_ofs, PAD(sizeof(*ri)+datalen), f->inocache); |
176 | if (IS_ERR(fn->raw)) { | ||
177 | void *hold_err = fn->raw; | ||
178 | /* Release the full_dnode which is now useless, and return */ | ||
179 | jffs2_free_full_dnode(fn); | ||
180 | return ERR_PTR(PTR_ERR(hold_err)); | ||
181 | } | ||
176 | fn->ofs = je32_to_cpu(ri->offset); | 182 | fn->ofs = je32_to_cpu(ri->offset); |
177 | fn->size = je32_to_cpu(ri->dsize); | 183 | fn->size = je32_to_cpu(ri->dsize); |
178 | fn->frags = 0; | 184 | fn->frags = 0; |
@@ -291,6 +297,12 @@ struct jffs2_full_dirent *jffs2_write_dirent(struct jffs2_sb_info *c, struct jff | |||
291 | } | 297 | } |
292 | /* Mark the space used */ | 298 | /* Mark the space used */ |
293 | fd->raw = jffs2_add_physical_node_ref(c, flash_ofs | REF_PRISTINE, PAD(sizeof(*rd)+namelen), f->inocache); | 299 | fd->raw = jffs2_add_physical_node_ref(c, flash_ofs | REF_PRISTINE, PAD(sizeof(*rd)+namelen), f->inocache); |
300 | if (IS_ERR(fd->raw)) { | ||
301 | void *hold_err = fd->raw; | ||
302 | /* Release the full_dirent which is now useless, and return */ | ||
303 | jffs2_free_full_dirent(fd); | ||
304 | return ERR_PTR(PTR_ERR(hold_err)); | ||
305 | } | ||
294 | 306 | ||
295 | if (retried) { | 307 | if (retried) { |
296 | jffs2_dbg_acct_sanity_check(c,NULL); | 308 | jffs2_dbg_acct_sanity_check(c,NULL); |