From mboxrd@z Thu Jan 1 00:00:00 1970 From: Greg Kurz Subject: Re: [V9fs-developer] [PATCH] net/9p: fix error path of p9_virtio_probe Date: Thu, 24 May 2018 16:22:24 +0200 Message-ID: <20180524162224.56c64708@bahia.lan> References: <20180524101021.49880-1-jean-philippe.brucker@arm.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: v9fs-developer@lists.sourceforge.net, ericvh@gmail.com, rminnich@sandia.gov, lucho@ionkov.net, netdev@vger.kernel.org, davem@davemloft.net To: Jean-Philippe Brucker Return-path: Received: from 5.mo5.mail-out.ovh.net ([87.98.173.103]:46684 "EHLO 5.mo5.mail-out.ovh.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S967064AbeEXPkp (ORCPT ); Thu, 24 May 2018 11:40:45 -0400 Received: from player690.ha.ovh.net (unknown [10.109.105.75]) by mo5.mail-out.ovh.net (Postfix) with ESMTP id 28BF01B2FF5 for ; Thu, 24 May 2018 16:22:34 +0200 (CEST) In-Reply-To: <20180524101021.49880-1-jean-philippe.brucker@arm.com> Sender: netdev-owner@vger.kernel.org List-ID: On Thu, 24 May 2018 11:10:21 +0100 Jean-Philippe Brucker 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 > --- Reviewed-by: Greg Kurz > 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;