diff options
author | Dan Carpenter <dan.carpenter@oracle.com> | 2017-08-30 17:04:56 +0300 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2017-09-01 08:17:55 -0600 |
commit | ef13ecbc134d7e0ca4ab4834d08bd20885b53c62 (patch) | |
tree | 300c7cc86289eba9d1917401ef5ab66e8dae37c9 /fs/kernfs | |
parent | 974c58566e0b047d785701b6cf788a810072a4c1 (diff) |
kernfs: checking for IS_ERR() instead of NULL
The kernfs_get_inode() returns NULL on error, it never returns error
pointers.
Fixes: aa8188253474 ("kernfs: add exportfs operations")
Acked-by: Tejun Heo <tj@kernel.org>
Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'fs/kernfs')
-rw-r--r-- | fs/kernfs/mount.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/fs/kernfs/mount.c b/fs/kernfs/mount.c index 7c452f4d83e9..95a7c88baed9 100644 --- a/fs/kernfs/mount.c +++ b/fs/kernfs/mount.c @@ -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.. */ |