net/9p: fix error path of p9_virtio_probe
[muen/linux.git] / net / 9p / trans_virtio.c
index 05006cbb33616e4a30de07180c1d400c91d05a10..eaacce086427f74e451d36a7560c8e0896b03f99 100644 (file)
@@ -563,7 +563,7 @@ static int p9_virtio_probe(struct virtio_device *vdev)
        chan->vq = virtio_find_single_vq(vdev, req_done, "requests");
        if (IS_ERR(chan->vq)) {
                err = PTR_ERR(chan->vq);
-               goto out_free_vq;
+               goto out_free_chan;
        }
        chan->vq->vdev->priv = chan;
        spin_lock_init(&chan->lock);
@@ -616,6 +616,7 @@ out_free_tag:
        kfree(tag);
 out_free_vq:
        vdev->config->del_vqs(vdev);
+out_free_chan:
        kfree(chan);
 fail:
        return err;