aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ocfs2/namei.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/ocfs2/namei.c')
-rw-r--r--fs/ocfs2/namei.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/fs/ocfs2/namei.c b/fs/ocfs2/namei.c
index f95f3654ee68..2545e7402efe 100644
--- a/fs/ocfs2/namei.c
+++ b/fs/ocfs2/namei.c
@@ -378,8 +378,8 @@ static int ocfs2_mknod_locked(struct ocfs2_super *osb,
378 } 378 }
379 379
380 inode = new_inode(dir->i_sb); 380 inode = new_inode(dir->i_sb);
381 if (IS_ERR(inode)) { 381 if (!inode) {
382 status = PTR_ERR(inode); 382 status = -ENOMEM;
383 mlog(ML_ERROR, "new_inode failed!\n"); 383 mlog(ML_ERROR, "new_inode failed!\n");
384 goto leave; 384 goto leave;
385 } 385 }
@@ -491,8 +491,10 @@ leave:
491 brelse(*new_fe_bh); 491 brelse(*new_fe_bh);
492 *new_fe_bh = NULL; 492 *new_fe_bh = NULL;
493 } 493 }
494 if (inode) 494 if (inode) {
495 clear_nlink(inode);
495 iput(inode); 496 iput(inode);
497 }
496 } 498 }
497 499
498 mlog_exit(status); 500 mlog_exit(status);