summaryrefslogtreecommitdiffstats
path: root/fs/nfs/nfs4idmap.c
diff options
context:
space:
mode:
authorChengguang Xu2018-06-28 05:09:45 +0200
committerAnna Schumaker2018-07-30 19:19:40 +0200
commit12b289cfacac1f7b0a22ebb3d86def7198d26e47 (patch)
treee8df1f3fda0e879d75622408501b0156224d25bf /fs/nfs/nfs4idmap.c
parentFix error code in nfs_lookup_verify_inode() (diff)
downloadkernel-qcow2-linux-12b289cfacac1f7b0a22ebb3d86def7198d26e47.tar.gz
kernel-qcow2-linux-12b289cfacac1f7b0a22ebb3d86def7198d26e47.tar.xz
kernel-qcow2-linux-12b289cfacac1f7b0a22ebb3d86def7198d26e47.zip
nfs: add error check in nfs_idmap_prepare_message()
Even though the caller of nfs_idmap_prepare_message() checks return code in their side but it's better to add an error check for match_int() so that we can avoid unnecessary operations when bad int arg is detected. Signed-off-by: Chengguang Xu <cgxu519@gmx.com> Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
Diffstat (limited to 'fs/nfs/nfs4idmap.c')
-rw-r--r--fs/nfs/nfs4idmap.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/fs/nfs/nfs4idmap.c b/fs/nfs/nfs4idmap.c
index b6f9d84ba19b..cf72169d6c64 100644
--- a/fs/nfs/nfs4idmap.c
+++ b/fs/nfs/nfs4idmap.c
@@ -516,6 +516,8 @@ static int nfs_idmap_prepare_message(char *desc, struct idmap *idmap,
case Opt_find_group:
im->im_conv = IDMAP_CONV_IDTONAME;
ret = match_int(&substr, &im->im_id);
+ if (ret)
+ goto out;
break;
default: