Skip to content

Commit

Permalink
NFSD: Fix bad using of return value from qword_get
Browse files Browse the repository at this point in the history
Signed-off-by: Kinglong Mee <[email protected]>
Signed-off-by: J. Bruce Fields <[email protected]>
  • Loading branch information
kinglongmee authored and J. Bruce Fields committed Sep 3, 2014
1 parent 15d176c commit 48c348b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions fs/nfsd/nfs4idmap.c
Original file line number Diff line number Diff line change
Expand Up @@ -368,7 +368,7 @@ nametoid_parse(struct cache_detail *cd, char *buf, int buflen)
{
struct ent ent, *res;
char *buf1;
int error = -EINVAL;
int len, error = -EINVAL;

if (buf[buflen - 1] != '\n')
return (-EINVAL);
Expand All @@ -392,8 +392,8 @@ nametoid_parse(struct cache_detail *cd, char *buf, int buflen)
IDMAP_TYPE_USER : IDMAP_TYPE_GROUP;

/* Name */
error = qword_get(&buf, buf1, PAGE_SIZE);
if (error <= 0 || error >= IDMAP_NAMESZ)
len = qword_get(&buf, buf1, PAGE_SIZE);
if (len <= 0 || len >= IDMAP_NAMESZ)
goto out;
memcpy(ent.name, buf1, sizeof(ent.name));

Expand Down

0 comments on commit 48c348b

Please sign in to comment.