diff options
author | Kinglong Mee <kinglongmee@gmail.com> | 2014-09-02 16:13:32 +0200 |
---|---|---|
committer | J. Bruce Fields <bfields@redhat.com> | 2014-09-03 23:43:02 +0200 |
commit | 48c348b09c6b35b1cf6f2125d1d4fd7c962dd79d (patch) | |
tree | 1bd8f80bd60e47e34b91cd1ca319976d24e16923 /fs/nfsd/nfs4idmap.c | |
parent | NFSD: Fix a memory leak if nfsd4_recdir_load fail (diff) | |
download | linux-48c348b09c6b35b1cf6f2125d1d4fd7c962dd79d.tar.xz linux-48c348b09c6b35b1cf6f2125d1d4fd7c962dd79d.zip |
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>
Diffstat (limited to 'fs/nfsd/nfs4idmap.c')
-rw-r--r-- | fs/nfsd/nfs4idmap.c | 6 |
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) { struct ent ent, *res; char *buf1; - int error = -EINVAL; + int len, error = -EINVAL; if (buf[buflen - 1] != '\n') return (-EINVAL); @@ -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)); |