提交 9f3e9bbe 编写于 作者: R Roel Kluin 提交者: Eric Van Hensbergen

unsigned fid->fid cannot be negative

Signed-off-by: NRoel Kluin <roel.kluin@gmail.com>
Signed-off-by: NEric Van Hensbergen <ericvh@gmail.com>
上级 1558c621
...@@ -608,7 +608,7 @@ p9_client_rpc(struct p9_client *c, int8_t type, const char *fmt, ...) ...@@ -608,7 +608,7 @@ p9_client_rpc(struct p9_client *c, int8_t type, const char *fmt, ...)
static struct p9_fid *p9_fid_create(struct p9_client *clnt) static struct p9_fid *p9_fid_create(struct p9_client *clnt)
{ {
int err; int ret;
struct p9_fid *fid; struct p9_fid *fid;
unsigned long flags; unsigned long flags;
...@@ -617,11 +617,12 @@ static struct p9_fid *p9_fid_create(struct p9_client *clnt) ...@@ -617,11 +617,12 @@ static struct p9_fid *p9_fid_create(struct p9_client *clnt)
if (!fid) if (!fid)
return ERR_PTR(-ENOMEM); return ERR_PTR(-ENOMEM);
fid->fid = p9_idpool_get(clnt->fidpool); ret = p9_idpool_get(clnt->fidpool);
if (fid->fid < 0) { if (fid->fid < 0) {
err = -ENOSPC; ret = -ENOSPC;
goto error; goto error;
} }
fid->fid = ret;
memset(&fid->qid, 0, sizeof(struct p9_qid)); memset(&fid->qid, 0, sizeof(struct p9_qid));
fid->mode = -1; fid->mode = -1;
...@@ -638,7 +639,7 @@ static struct p9_fid *p9_fid_create(struct p9_client *clnt) ...@@ -638,7 +639,7 @@ static struct p9_fid *p9_fid_create(struct p9_client *clnt)
error: error:
kfree(fid); kfree(fid);
return ERR_PTR(err); return ERR_PTR(ret);
} }
static void p9_fid_destroy(struct p9_fid *fid) static void p9_fid_destroy(struct p9_fid *fid)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册