Commit 5bdec5bf authored by Jean-Philippe Brucker's avatar Jean-Philippe Brucker Committed by Kleber Sacilotto de Souza

net/9p: fix error path of p9_virtio_probe

BugLink: https://bugs.launchpad.net/bugs/1797563

[ Upstream commit 92aef467 ]

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.comSigned-off-by: default avatarJean-Philippe Brucker <jean-philippe.brucker@arm.com>
Reviewed-by: default avatarGreg 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: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarDominique Martinet <dominique.martinet@cea.fr>
Signed-off-by: default avatarSasha Levin <alexander.levin@microsoft.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: default avatarStefan Bader <stefan.bader@canonical.com>
Signed-off-by: default avatarKleber Sacilotto de Souza <kleber.souza@canonical.com>
parent fa9b9f7f
...@@ -574,7 +574,7 @@ static int p9_virtio_probe(struct virtio_device *vdev) ...@@ -574,7 +574,7 @@ static int p9_virtio_probe(struct virtio_device *vdev)
chan->vq = virtio_find_single_vq(vdev, req_done, "requests"); chan->vq = virtio_find_single_vq(vdev, req_done, "requests");
if (IS_ERR(chan->vq)) { if (IS_ERR(chan->vq)) {
err = PTR_ERR(chan->vq); err = PTR_ERR(chan->vq);
goto out_free_vq; goto out_free_chan;
} }
chan->vq->vdev->priv = chan; chan->vq->vdev->priv = chan;
spin_lock_init(&chan->lock); spin_lock_init(&chan->lock);
...@@ -627,6 +627,7 @@ static int p9_virtio_probe(struct virtio_device *vdev) ...@@ -627,6 +627,7 @@ static int p9_virtio_probe(struct virtio_device *vdev)
kfree(tag); kfree(tag);
out_free_vq: out_free_vq:
vdev->config->del_vqs(vdev); vdev->config->del_vqs(vdev);
out_free_chan:
kfree(chan); kfree(chan);
fail: fail:
return err; return err;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment