提交 48c348b0 编写于 作者: K Kinglong Mee 提交者: J. Bruce Fields

NFSD: Fix bad using of return value from qword_get

Signed-off-by: NKinglong Mee <kinglongmee@gmail.com>
Signed-off-by: NJ. Bruce Fields <bfields@redhat.com>
上级 15d176c1
...@@ -368,7 +368,7 @@ nametoid_parse(struct cache_detail *cd, char *buf, int buflen) ...@@ -368,7 +368,7 @@ nametoid_parse(struct cache_detail *cd, char *buf, int buflen)
{ {
struct ent ent, *res; struct ent ent, *res;
char *buf1; char *buf1;
int error = -EINVAL; int len, error = -EINVAL;
if (buf[buflen - 1] != '\n') if (buf[buflen - 1] != '\n')
return (-EINVAL); return (-EINVAL);
...@@ -392,8 +392,8 @@ nametoid_parse(struct cache_detail *cd, char *buf, int buflen) ...@@ -392,8 +392,8 @@ nametoid_parse(struct cache_detail *cd, char *buf, int buflen)
IDMAP_TYPE_USER : IDMAP_TYPE_GROUP; IDMAP_TYPE_USER : IDMAP_TYPE_GROUP;
/* Name */ /* Name */
error = qword_get(&buf, buf1, PAGE_SIZE); len = qword_get(&buf, buf1, PAGE_SIZE);
if (error <= 0 || error >= IDMAP_NAMESZ) if (len <= 0 || len >= IDMAP_NAMESZ)
goto out; goto out;
memcpy(ent.name, buf1, sizeof(ent.name)); memcpy(ent.name, buf1, sizeof(ent.name));
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册