Thread (25 messages) 25 messages, 1 author, 2018-08-30
STALE2860d REVIEWED: 1 (0M)

[PATCH AUTOSEL 3.18 12/25] net/9p: fix error path of p9_virtio_probe

From: Sasha Levin <hidden>
Date: 2018-08-30 22:22:06
Subsystem: 9p file system, the rest · Maintainers: Eric Van Hensbergen, Latchesar Ionkov, Dominique Martinet, Linus Torvalds

From: Jean-Philippe Brucker <redacted>

[ Upstream commit 92aef4675d5b1b55404e1532379e343bed0e5cf2 ]

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 <redacted>
Reviewed-by: Greg Kurz <redacted>
Cc: Eric Van Hensbergen <redacted>
Cc: Ron Minnich <redacted>
Cc: Latchesar Ionkov <lucho@ionkov.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Dominique Martinet <redacted>
Signed-off-by: Sasha Levin <redacted>
---
 net/9p/trans_virtio.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/net/9p/trans_virtio.c b/net/9p/trans_virtio.c
index 071ac5c495fc..05fa26cd0698 100644
--- a/net/9p/trans_virtio.c
+++ b/net/9p/trans_virtio.c
@@ -536,7 +536,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);
@@ -589,6 +589,7 @@ static int p9_virtio_probe(struct virtio_device *vdev)
 	kfree(tag);
 out_free_vq:
 	vdev->config->del_vqs(vdev);
+out_free_chan:
 	kfree(chan);
 fail:
 	return err;
-- 
2.17.1
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help