Skip to content

Commit

Permalink
kernfs: checking for IS_ERR() instead of NULL
Browse files Browse the repository at this point in the history
The kernfs_get_inode() returns NULL on error, it never returns error
pointers.

Fixes: aa81882 ("kernfs: add exportfs operations")
Acked-by: Tejun Heo <[email protected]>
Acked-by: Greg Kroah-Hartman <[email protected]>
Signed-off-by: Dan Carpenter <[email protected]>
Signed-off-by: Jens Axboe <[email protected]>
  • Loading branch information
Dan Carpenter authored and axboe committed Sep 1, 2017
1 parent 974c585 commit ef13ecb
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions fs/kernfs/mount.c
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,8 @@ static struct inode *kernfs_fh_get_inode(struct super_block *sb,
return ERR_PTR(-ESTALE);
inode = kernfs_get_inode(sb, kn);
kernfs_put(kn);
if (IS_ERR(inode))
return ERR_CAST(inode);
if (!inode)
return ERR_PTR(-ESTALE);

if (generation && inode->i_generation != generation) {
/* we didn't find the right inode.. */
Expand Down

0 comments on commit ef13ecb

Please sign in to comment.