forked from luck/tmp_suning_uos_patched
kernfs: checking for IS_ERR() instead of NULL
The kernfs_get_inode() returns NULL on error, it never returns error
pointers.
Fixes: aa81882534
("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>
This commit is contained in:
parent
974c58566e
commit
ef13ecbc13
|
@ -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.. */
|
||||
|
|
Loading…
Reference in New Issue
Block a user