OSDN Git Service

net/9p: fix error path of p9_virtio_probe
authorJean-Philippe Brucker <jean-philippe.brucker@arm.com>
Wed, 18 Jul 2018 02:14:45 +0000 (19:14 -0700)
committerDominique Martinet <dominique.martinet@cea.fr>
Mon, 13 Aug 2018 00:21:44 +0000 (09:21 +0900)
Currently when virtio_find_single_vq fails, we go through del_vqs which
throws a warning (Trying to free already-free IRQ).  Skip del_vqs if vq
allocation failed.

Link: http://lkml.kernel.org/r/20180524101021.49880-1-jean-philippe.brucker@arm.com
Signed-off-by: Jean-Philippe Brucker <jean-philippe.brucker@arm.com>
Reviewed-by: Greg Kurz <groug@kaod.org>
Cc: Eric Van Hensbergen <ericvh@gmail.com>
Cc: Ron Minnich <rminnich@sandia.gov>
Cc: Latchesar Ionkov <lucho@ionkov.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Dominique Martinet <dominique.martinet@cea.fr>
net/9p/trans_virtio.c

index 05006cb..eaacce0 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;