From: Kinglong Mee Date: Sat, 24 May 2014 03:26:49 +0000 (+0800) Subject: NFSD: Using type of uint32_t for ex_nflavors instead of int X-Git-Tag: firefly_0821_release~176^2~3796^2~19 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=1f53146da9cb2c941a3928320a6824d3b035455f;p=firefly-linux-kernel-4.4.55.git NFSD: Using type of uint32_t for ex_nflavors instead of int ex_nflavors can't be negative number, just defined by uint32_t. Signed-off-by: Kinglong Mee Signed-off-by: J. Bruce Fields --- diff --git a/fs/nfsd/export.c b/fs/nfsd/export.c index 263d30e7972e..788405107006 100644 --- a/fs/nfsd/export.c +++ b/fs/nfsd/export.c @@ -438,13 +438,14 @@ out_free_all: static int secinfo_parse(char **mesg, char *buf, struct svc_export *exp) { - int listsize, err; struct exp_flavor_info *f; + u32 listsize; + int err; - err = get_int(mesg, &listsize); + err = get_uint(mesg, &listsize); if (err) return err; - if (listsize < 0 || listsize > MAX_SECINFO_LIST) + if (listsize > MAX_SECINFO_LIST) return -EINVAL; for (f = exp->ex_flavors; f < exp->ex_flavors + listsize; f++) { diff --git a/fs/nfsd/export.h b/fs/nfsd/export.h index c7d4ed05e470..cfeea85c5bed 100644 --- a/fs/nfsd/export.h +++ b/fs/nfsd/export.h @@ -54,7 +54,7 @@ struct svc_export { int ex_fsid; unsigned char * ex_uuid; /* 16 byte fsid */ struct nfsd4_fs_locations ex_fslocs; - int ex_nflavors; + uint32_t ex_nflavors; struct exp_flavor_info ex_flavors[MAX_SECINFO_LIST]; struct cache_detail *cd; };