Commit 1b794a5d authored by YueHaibing's avatar YueHaibing Committed by Kleber Sacilotto de Souza

exportfs: fix 'passing zero to ERR_PTR()' warning

BugLink: https://bugs.launchpad.net/bugs/1864773

[ Upstream commit 909e22e0 ]

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: bbf7a8a3 ("exportfs: move most of reconnect_path to helper function")
Signed-off-by: default avatarYueHaibing <yuehaibing@huawei.com>
Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
Signed-off-by: default avatarKhalid Elmously <khalid.elmously@canonical.com>
Signed-off-by: default avatarKleber Sacilotto de Souza <kleber.souza@canonical.com>
parent 531a071c
...@@ -148,6 +148,7 @@ static struct dentry *reconnect_one(struct vfsmount *mnt, ...@@ -148,6 +148,7 @@ static struct dentry *reconnect_one(struct vfsmount *mnt,
mutex_unlock(&parent->d_inode->i_mutex); mutex_unlock(&parent->d_inode->i_mutex);
if (IS_ERR(tmp)) { if (IS_ERR(tmp)) {
dprintk("%s: lookup failed: %d\n", __func__, PTR_ERR(tmp)); dprintk("%s: lookup failed: %d\n", __func__, PTR_ERR(tmp));
err = PTR_ERR(tmp);
goto out_err; goto out_err;
} }
if (tmp != dentry) { if (tmp != dentry) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment