Skip to content

Commit

Permalink
orangefs: don't let orangefs_iget return NULL.
Browse files Browse the repository at this point in the history
Suggested by Dan Carpenter.

Signed-off-by: Mike Marshall <hubcap@omnibond.com>
  • Loading branch information
hubcapsc committed Oct 18, 2018
1 parent 5624999 commit b5d72cd
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion fs/orangefs/inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -405,7 +405,11 @@ struct inode *orangefs_iget(struct super_block *sb,
orangefs_test_inode,
orangefs_set_inode,
ref);
if (!inode || !(inode->i_state & I_NEW))

if (!inode)
return ERR_PTR(-ENOMEM);

if (!(inode->i_state & I_NEW))
return inode;

error = orangefs_inode_getattr(inode, 1, 1, STATX_ALL);
Expand Down

0 comments on commit b5d72cd

Please sign in to comment.