diff options
author | Mike Marshall <hubcap@omnibond.com> | 2018-10-18 19:52:23 +0200 |
---|---|---|
committer | Mike Marshall <hubcap@omnibond.com> | 2018-10-18 19:52:23 +0200 |
commit | b5d72cdc53bd13a363943a67a8c5537b9524c94d (patch) | |
tree | 42f104606c4d248e000944967ac8c488ae1435bb /fs/orangefs | |
parent | orangefs: don't let orangefs_new_inode return NULL (diff) | |
download | linux-b5d72cdc53bd13a363943a67a8c5537b9524c94d.tar.xz linux-b5d72cdc53bd13a363943a67a8c5537b9524c94d.zip |
orangefs: don't let orangefs_iget return NULL.
Suggested by Dan Carpenter.
Signed-off-by: Mike Marshall <hubcap@omnibond.com>
Diffstat (limited to 'fs/orangefs')
-rw-r--r-- | fs/orangefs/inode.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/fs/orangefs/inode.c b/fs/orangefs/inode.c index c1b4ce399ab7..5e65d818937b 100644 --- a/fs/orangefs/inode.c +++ b/fs/orangefs/inode.c @@ -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); |