Return-Path: Received: from mail-dm3nam03on0136.outbound.protection.outlook.com ([104.47.41.136]:30240 "EHLO NAM03-DM3-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728081AbeH3WTp (ORCPT ); Thu, 30 Aug 2018 18:19:45 -0400 From: Sasha Levin To: "stable@vger.kernel.org" CC: Jean-Philippe Brucker , Eric Van Hensbergen , Ron Minnich , Latchesar Ionkov , Andrew Morton , Dominique Martinet , Sasha Levin Subject: [PATCH AUTOSEL 4.4 17/30] net/9p: fix error path of p9_virtio_probe Date: Thu, 30 Aug 2018 18:16:19 +0000 Message-ID: <20180830181533.36683-17-alexander.levin@microsoft.com> References: <20180830181533.36683-1-alexander.levin@microsoft.com> In-Reply-To: <20180830181533.36683-1-alexander.levin@microsoft.com> Content-Language: en-US Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org List-ID: From: Jean-Philippe Brucker [ 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 Reviewed-by: Greg Kurz Cc: Eric Van Hensbergen Cc: Ron Minnich Cc: Latchesar Ionkov Signed-off-by: Andrew Morton Signed-off-by: Dominique Martinet Signed-off-by: Sasha Levin --- 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 2ddeecca5b12..17e64f48af37 100644 --- a/net/9p/trans_virtio.c +++ b/net/9p/trans_virtio.c @@ -566,7 +566,7 @@ static int p9_virtio_probe(struct virtio_device *vdev) chan->vq =3D virtio_find_single_vq(vdev, req_done, "requests"); if (IS_ERR(chan->vq)) { err =3D PTR_ERR(chan->vq); - goto out_free_vq; + goto out_free_chan; } chan->vq->vdev->priv =3D chan; spin_lock_init(&chan->lock); @@ -619,6 +619,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; --=20 2.17.1