diff mbox

UBIFS:adjust the procedure in ubifs_new_inode when there is oom occured

Message ID OFD2C891FD.BC4CAFE0-ON48257DA4.002ECC4A-48257DA4.00326450@zte.com.cn
State Deferred
Headers show

Commit Message

Liu Song Dec. 4, 2014, 9:11 a.m. UTC
hi,
In ubifs_new_inode, if failed to get a new inode then will return ERR_PTR.
Maybe adjust the code sequence would make sense.

Signed-off-by: Liu Song <liu.song11@zte.com.cn>
--------------------------------------------------------------

--------------------------------------------------------
ZTE Information Security Notice: The information contained in this mail (and any attachment transmitted herewith) is privileged and confidential and is intended for the exclusive use of the addressee(s).  If you are not an intended recipient, any disclosure, reproduction, distribution or other dissemination or use of the information contained is strictly prohibited.  If you have received this mail in error, please delete it and notify us immediately.
diff mbox

Patch

diff --git a/fs/ubifs/dir.c b/fs/ubifs/dir.c
index de8fc9b..6dafe23 100644
--- a/fs/ubifs/dir.c
+++ b/fs/ubifs/dir.c
@@ -92,10 +92,9 @@  struct inode *ubifs_new_inode(struct ubifs_info *c, const struct inode *dir,
 	struct ubifs_inode *ui;

 	inode = new_inode(c->vfs_sb);
-	ui = ubifs_inode(inode);
 	if (!inode)
 		return ERR_PTR(-ENOMEM);
-
+	ui = ubifs_inode(inode);
 	/*
 	 * Set 'S_NOCMTIME' to prevent VFS form updating [mc]time of inodes and
 	 * marking them dirty in file write path (see 'file_update_time()').