]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - net/9p/client.c
9p: Remove unneeded free of fcall for Flush
[linux-2.6-omap-h63xx.git] / net / 9p / client.c
index bbac2f72b4d27c00e8692ee10760b3f5fa56d9b8..26ca8ab451966b1e11a6914e106815f0b844b7e2 100644 (file)
@@ -159,6 +159,7 @@ static struct p9_req_t *p9_tag_alloc(struct p9_client *c, u16 tag)
 
                        if (!c->reqs[row]) {
                                printk(KERN_ERR "Couldn't grow tag array\n");
+                               spin_unlock_irqrestore(&c->lock, flags);
                                return ERR_PTR(-ENOMEM);
                        }
                        for (col = 0; col < P9_ROW_MAXTAG; col++) {
@@ -310,12 +311,6 @@ static void p9_free_req(struct p9_client *c, struct p9_req_t *r)
        r->status = REQ_STATUS_IDLE;
        if (tag != P9_NOTAG && p9_idpool_check(tag, c->tagpool))
                p9_idpool_put(tag, c->tagpool);
-
-       /* if this was a flush request we have to free response fcall */
-       if (r->rc->id == P9_RFLUSH) {
-               kfree(r->tc);
-               kfree(r->rc);
-       }
 }
 
 /**
@@ -612,6 +607,7 @@ static struct p9_fid *p9_fid_create(struct p9_client *clnt)
 {
        int err;
        struct p9_fid *fid;
+       unsigned long flags;
 
        P9_DPRINTK(P9_DEBUG_FID, "clnt %p\n", clnt);
        fid = kmalloc(sizeof(struct p9_fid), GFP_KERNEL);
@@ -631,9 +627,9 @@ static struct p9_fid *p9_fid_create(struct p9_client *clnt)
        fid->clnt = clnt;
        fid->aux = NULL;
 
-       spin_lock(&clnt->lock);
+       spin_lock_irqsave(&clnt->lock, flags);
        list_add(&fid->flist, &clnt->fidlist);
-       spin_unlock(&clnt->lock);
+       spin_unlock_irqrestore(&clnt->lock, flags);
 
        return fid;
 
@@ -645,13 +641,14 @@ error:
 static void p9_fid_destroy(struct p9_fid *fid)
 {
        struct p9_client *clnt;
+       unsigned long flags;
 
        P9_DPRINTK(P9_DEBUG_FID, "fid %d\n", fid->fid);
        clnt = fid->clnt;
        p9_idpool_put(fid->fid, clnt->fidpool);
-       spin_lock(&clnt->lock);
+       spin_lock_irqsave(&clnt->lock, flags);
        list_del(&fid->flist);
-       spin_unlock(&clnt->lock);
+       spin_unlock_irqrestore(&clnt->lock, flags);
        kfree(fid);
 }