Skip to content

Commit

Permalink
exportfs: fix 'passing zero to ERR_PTR()' warning
Browse files Browse the repository at this point in the history
Fix a static code checker warning:
  fs/exportfs/expfs.c:171 reconnect_one() warn: passing zero to 'ERR_PTR'

The error path for lookup_one_len_unlocked failure
should set err to PTR_ERR.

Fixes: bbf7a8a ("exportfs: move most of reconnect_path to helper function")
Signed-off-by: YueHaibing <yuehaibing@huawei.com>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
  • Loading branch information
YueHaibing authored and Al Viro committed Nov 19, 2018
1 parent 53fffe2 commit 909e22e
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions fs/exportfs/expfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,7 @@ static struct dentry *reconnect_one(struct vfsmount *mnt,
tmp = lookup_one_len_unlocked(nbuf, parent, strlen(nbuf));
if (IS_ERR(tmp)) {
dprintk("%s: lookup failed: %d\n", __func__, PTR_ERR(tmp));
err = PTR_ERR(tmp);
goto out_err;
}
if (tmp != dentry) {
Expand Down

0 comments on commit 909e22e

Please sign in to comment.