Skip to content

Commit

Permalink
NFSD: Using type of uint32_t for ex_nflavors instead of int
Browse files Browse the repository at this point in the history
ex_nflavors can't be negative number, just defined by uint32_t.

Signed-off-by: Kinglong Mee <kinglongmee@gmail.com>
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
  • Loading branch information
Kinglong Mee authored and J. Bruce Fields committed May 30, 2014
1 parent f0db79d commit 1f53146
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
7 changes: 4 additions & 3 deletions fs/nfsd/export.c
Original file line number Diff line number Diff line change
Expand Up @@ -438,13 +438,14 @@ fsloc_parse(char **mesg, char *buf, struct nfsd4_fs_locations *fsloc)

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++) {
Expand Down
2 changes: 1 addition & 1 deletion fs/nfsd/export.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
};
Expand Down

0 comments on commit 1f53146

Please sign in to comment.