dentry_open() and fh_to_parent() were calling PTR_ERR() before checking IS_ERR(). Drop the redundant sched.h include too, cred.h already pulls it in. Signed-off-by: Yi Xie --- fs/exportfs/expfs.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/fs/exportfs/expfs.c b/fs/exportfs/expfs.c index fbd45e7ae706..e2c5fe252606 100644 --- a/fs/exportfs/expfs.c +++ b/fs/exportfs/expfs.c @@ -15,7 +15,6 @@ #include #include #include -#include #include #define dprintk(fmt, args...) pr_debug(fmt, ##args) @@ -310,9 +309,10 @@ static int get_name(const struct path *path, char *name, struct dentry *child) * Open the directory ... */ file = dentry_open(path, O_RDONLY, cred); - error = PTR_ERR(file); - if (IS_ERR(file)) + if (IS_ERR(file)) { + error = PTR_ERR(file); goto out; + } error = -EINVAL; if (!file->f_op->iterate_shared) @@ -524,9 +524,10 @@ exportfs_decode_fh_raw(struct vfsmount *mnt, struct fid *fid, int fh_len, fh_len, fileid_type); if (!target_dir) goto err_result; - err = PTR_ERR(target_dir); - if (IS_ERR(target_dir)) + if (IS_ERR(target_dir)) { + err = PTR_ERR(target_dir); goto err_result; + } /* * And as usual we need to make sure the parent directory is -- 2.25.1