summaryrefslogtreecommitdiff
path: root/fs/nfs
diff options
context:
space:
mode:
authorEric W. Biederman <ebiederm@xmission.com>2019-01-30 16:58:38 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2020-01-29 12:21:40 +0300
commit983f90b9ccb944bd12866faf151900679d95f17d (patch)
tree7c00ff99d1b64a526b23992f710968632833221a /fs/nfs
parent00b71397e89d5a8b0bbfeccc92110d05d6bf11eb (diff)
downloadlinux-983f90b9ccb944bd12866faf151900679d95f17d.tar.xz
fs/nfs: Fix nfs_parse_devname to not modify it's argument
[ Upstream commit 40cc394be1aa18848b8757e03bd8ed23281f572e ] In the rare and unsupported case of a hostname list nfs_parse_devname will modify dev_name. There is no need to modify dev_name as the all that is being computed is the length of the hostname, so the computed length can just be shorted. Fixes: dc04589827f7 ("NFS: Use common device name parsing logic for NFSv4 and NFSv2/v3") Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com> Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com> Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'fs/nfs')
-rw-r--r--fs/nfs/super.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/nfs/super.c b/fs/nfs/super.c
index dced329a8584..47a7751146cf 100644
--- a/fs/nfs/super.c
+++ b/fs/nfs/super.c
@@ -1901,7 +1901,7 @@ static int nfs_parse_devname(const char *dev_name,
/* kill possible hostname list: not supported */
comma = strchr(dev_name, ',');
if (comma != NULL && comma < end)
- *comma = 0;
+ len = comma - dev_name;
}
if (len > maxnamlen)