From: Chengguang Xu Date: Thu, 28 Jun 2018 03:09:45 +0000 (+0800) Subject: nfs: add error check in nfs_idmap_prepare_message() X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=12b289cfacac1f7b0a22ebb3d86def7198d26e47;p=linux.git 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 Signed-off-by: Anna Schumaker --- diff --git a/fs/nfs/nfs4idmap.c b/fs/nfs/nfs4idmap.c index b6f9d84ba19b1..cf72169d6c642 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: