aboutsummaryrefslogtreecommitdiffstats
path: root/net/9p
diff options
context:
space:
mode:
authorRoel Kluin <roel.kluin@gmail.com>2008-10-28 15:22:43 -0400
committerEric Van Hensbergen <ericvh@gmail.com>2008-11-05 14:19:07 -0500
commit9f3e9bbe62b0bdbbaa7c689a68a22a7d3c1670f0 (patch)
treebec9f1b0880c5d1b89d3dc297d53951c5da4231b /net/9p
parent1558c6214904c636d5a37f05f84202d6cdd9cff8 (diff)
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/9p')
-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:
608 608
609static struct p9_fid *p9_fid_create(struct p9_client *clnt) 609static struct p9_fid *p9_fid_create(struct p9_client *clnt)
610{ 610{
611 int err; 611 int ret;
612 struct p9_fid *fid; 612 struct p9_fid *fid;
613 unsigned long flags; 613 unsigned long flags;
614 614
@@ -617,11 +617,12 @@ static struct p9_fid *p9_fid_create(struct p9_client *clnt)
617 if (!fid) 617 if (!fid)
618 return ERR_PTR(-ENOMEM); 618 return ERR_PTR(-ENOMEM);
619 619
620 fid->fid = p9_idpool_get(clnt->fidpool); 620 ret = p9_idpool_get(clnt->fidpool);
621 if (fid->fid < 0) { 621 if (fid->fid < 0) {
622 err = -ENOSPC; 622 ret = -ENOSPC;
623 goto error; 623 goto error;
624 } 624 }
625 fid->fid = ret;
625 626
626 memset(&fid->qid, 0, sizeof(struct p9_qid)); 627 memset(&fid->qid, 0, sizeof(struct p9_qid));
627 fid->mode = -1; 628 fid->mode = -1;
@@ -638,7 +639,7 @@ static struct p9_fid *p9_fid_create(struct p9_client *clnt)
638 639
639error: 640error:
640 kfree(fid); 641 kfree(fid);
641 return ERR_PTR(err); 642 return ERR_PTR(ret);
642} 643}
643 644
644static void p9_fid_destroy(struct p9_fid *fid) 645static void p9_fid_destroy(struct p9_fid *fid)