aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKinglong Mee <kinglongmee@gmail.com>2014-09-02 10:13:32 -0400
committerJ. Bruce Fields <bfields@redhat.com>2014-09-03 17:43:02 -0400
commit48c348b09c6b35b1cf6f2125d1d4fd7c962dd79d (patch)
tree1bd8f80bd60e47e34b91cd1ca319976d24e16923
parent15d176c195b164db59dd4473a0cfb1ad0bfbd0a4 (diff)
NFSD: Fix bad using of return value from qword_get
Signed-off-by: Kinglong Mee <kinglongmee@gmail.com> Signed-off-by: J. Bruce Fields <bfields@redhat.com>
-rw-r--r--fs/nfsd/nfs4idmap.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/fs/nfsd/nfs4idmap.c b/fs/nfsd/nfs4idmap.c
index a0ab0a847d69..dc948f667650 100644
--- a/fs/nfsd/nfs4idmap.c
+++ b/fs/nfsd/nfs4idmap.c
@@ -368,7 +368,7 @@ nametoid_parse(struct cache_detail *cd, char *buf, int buflen)
368{ 368{
369 struct ent ent, *res; 369 struct ent ent, *res;
370 char *buf1; 370 char *buf1;
371 int error = -EINVAL; 371 int len, error = -EINVAL;
372 372
373 if (buf[buflen - 1] != '\n') 373 if (buf[buflen - 1] != '\n')
374 return (-EINVAL); 374 return (-EINVAL);
@@ -392,8 +392,8 @@ nametoid_parse(struct cache_detail *cd, char *buf, int buflen)
392 IDMAP_TYPE_USER : IDMAP_TYPE_GROUP; 392 IDMAP_TYPE_USER : IDMAP_TYPE_GROUP;
393 393
394 /* Name */ 394 /* Name */
395 error = qword_get(&buf, buf1, PAGE_SIZE); 395 len = qword_get(&buf, buf1, PAGE_SIZE);
396 if (error <= 0 || error >= IDMAP_NAMESZ) 396 if (len <= 0 || len >= IDMAP_NAMESZ)
397 goto out; 397 goto out;
398 memcpy(ent.name, buf1, sizeof(ent.name)); 398 memcpy(ent.name, buf1, sizeof(ent.name));
399 399