summaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorRoel Kluin <roel.kluin@gmail.com>2008-10-28 14:22:43 -0500
committerEric Van Hensbergen <ericvh@gmail.com>2008-11-05 13:19:07 -0600
commit9f3e9bbe62b0bdbbaa7c689a68a22a7d3c1670f0 (patch)
treebec9f1b0880c5d1b89d3dc297d53951c5da4231b /net
parent1558c6214904c636d5a37f05f84202d6cdd9cff8 (diff)
downloadlinux-9f3e9bbe62b0bdbbaa7c689a68a22a7d3c1670f0.tar.gz
linux-9f3e9bbe62b0bdbbaa7c689a68a22a7d3c1670f0.tar.bz2
linux-9f3e9bbe62b0bdbbaa7c689a68a22a7d3c1670f0.zip
unsigned fid->fid cannot be negative
Signed-off-by: Roel Kluin <roel.kluin@gmail.com> Signed-off-by: Eric Van Hensbergen <ericvh@gmail.com>
Diffstat (limited to 'net')
-rw-r--r--net/9p/client.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/net/9p/client.c b/net/9p/client.c
index b56d808e63a9..6e800dd51f09 100644
--- a/net/9p/client.c
+++ b/net/9p/client.c
@@ -608,7 +608,7 @@ reterr:
static struct p9_fid *p9_fid_create(struct p9_client *clnt)
{
- int err;
+ int ret;
struct p9_fid *fid;
unsigned long flags;
@@ -617,11 +617,12 @@ static struct p9_fid *p9_fid_create(struct p9_client *clnt)
if (!fid)
return ERR_PTR(-ENOMEM);
- fid->fid = p9_idpool_get(clnt->fidpool);
+ ret = p9_idpool_get(clnt->fidpool);
if (fid->fid < 0) {
- err = -ENOSPC;
+ ret = -ENOSPC;
goto error;
}
+ fid->fid = ret;
memset(&fid->qid, 0, sizeof(struct p9_qid));
fid->mode = -1;
@@ -638,7 +639,7 @@ static struct p9_fid *p9_fid_create(struct p9_client *clnt)
error:
kfree(fid);
- return ERR_PTR(err);
+ return ERR_PTR(ret);
}
static void p9_fid_destroy(struct p9_fid *fid)