netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] net/9p: fix error path of p9_virtio_probe
@ 2018-05-24 10:10 Jean-Philippe Brucker
  2018-05-24 14:22 ` [V9fs-developer] " Greg Kurz
  0 siblings, 1 reply; 2+ messages in thread
From: Jean-Philippe Brucker @ 2018-05-24 10:10 UTC (permalink / raw)
  To: v9fs-developer, ericvh, rminnich, lucho; +Cc: netdev, davem

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.

Signed-off-by: Jean-Philippe Brucker <jean-philippe.brucker@arm.com>
---
 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 4d0372263e5d..1c87eee522b7 100644
--- a/net/9p/trans_virtio.c
+++ b/net/9p/trans_virtio.c
@@ -562,7 +562,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);
@@ -615,6 +615,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.0

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [V9fs-developer] [PATCH] net/9p: fix error path of p9_virtio_probe
  2018-05-24 10:10 [PATCH] net/9p: fix error path of p9_virtio_probe Jean-Philippe Brucker
@ 2018-05-24 14:22 ` Greg Kurz
  0 siblings, 0 replies; 2+ messages in thread
From: Greg Kurz @ 2018-05-24 14:22 UTC (permalink / raw)
  To: Jean-Philippe Brucker
  Cc: v9fs-developer, ericvh, rminnich, lucho, netdev, davem

On Thu, 24 May 2018 11:10:21 +0100
Jean-Philippe Brucker <jean-philippe.brucker@arm.com> wrote:

> 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.
> 
> Signed-off-by: Jean-Philippe Brucker <jean-philippe.brucker@arm.com>
> ---

Reviewed-by: Greg Kurz <groug@kaod.org>

>  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 4d0372263e5d..1c87eee522b7 100644
> --- a/net/9p/trans_virtio.c
> +++ b/net/9p/trans_virtio.c
> @@ -562,7 +562,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);
> @@ -615,6 +615,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;

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2018-05-24 15:40 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-05-24 10:10 [PATCH] net/9p: fix error path of p9_virtio_probe Jean-Philippe Brucker
2018-05-24 14:22 ` [V9fs-developer] " Greg Kurz

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).