From: Sasha Levin <sashal@kernel•org>
To: linux-kernel@vger•kernel.org, stable@vger•kernel.org
Cc: Xianting Tian <xianting.tian@linux•alibaba.com>,
"Michael S . Tsirkin" <mst@redhat•com>,
Jason Wang <jasowang@redhat•com>, Sasha Levin <sashal@kernel•org>,
kvm@vger•kernel.org, virtualization@lists•linux-foundation.org,
netdev@vger•kernel.org
Subject: [PATCH AUTOSEL 5.16 15/19] vhost/test: fix memory leak of vhost virtqueues
Date: Sat, 22 Jan 2022 19:11:08 -0500 [thread overview]
Message-ID: <20220123001113.2460140-15-sashal@kernel.org> (raw)
In-Reply-To: <20220123001113.2460140-1-sashal@kernel.org>
From: Xianting Tian <xianting.tian@linux•alibaba.com>
[ Upstream commit 080063920777af65105e5953e2851e036376e3ea ]
We need free the vqs in .release(), which are allocated in .open().
Signed-off-by: Xianting Tian <xianting.tian@linux•alibaba.com>
Link: https://lore.kernel.org/r/20211228030924.3468439-1-xianting.tian@linux.alibaba.com
Signed-off-by: Michael S. Tsirkin <mst@redhat•com>
Acked-by: Jason Wang <jasowang@redhat•com>
Signed-off-by: Sasha Levin <sashal@kernel•org>
---
drivers/vhost/test.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/vhost/test.c b/drivers/vhost/test.c
index a09dedc79f682..05740cba1cd89 100644
--- a/drivers/vhost/test.c
+++ b/drivers/vhost/test.c
@@ -166,6 +166,7 @@ static int vhost_test_release(struct inode *inode, struct file *f)
/* We do an extra flush before freeing memory,
* since jobs can re-queue themselves. */
vhost_test_flush(n);
+ kfree(n->dev.vqs);
kfree(n);
return 0;
}
--
2.34.1
next prev parent reply other threads:[~2022-01-23 0:13 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20220123001113.2460140-1-sashal@kernel.org>
2022-01-23 0:11 ` [PATCH AUTOSEL 5.16 07/19] sit: allow encapsulated IPv6 traffic to be delivered locally Sasha Levin
2022-01-23 0:11 ` [PATCH AUTOSEL 5.16 09/19] net/smc: Resolve the race between link group access and termination Sasha Levin
2022-01-23 0:11 ` [PATCH AUTOSEL 5.16 10/19] net/smc: Resolve the race between SMC-R link access and clear Sasha Levin
2022-01-23 0:11 ` [PATCH AUTOSEL 5.16 11/19] net: apple: mace: Fix build since dev_addr constification Sasha Levin
2022-01-23 0:11 ` [PATCH AUTOSEL 5.16 12/19] net: apple: bmac: " Sasha Levin
2022-01-24 15:52 ` Jakub Kicinski
2022-01-23 0:11 ` Sasha Levin [this message]
2022-01-23 0:11 ` [PATCH AUTOSEL 5.16 16/19] vdpa: clean up get_config_size ret value handling Sasha Levin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220123001113.2460140-15-sashal@kernel.org \
--to=sashal@kernel$(echo .)org \
--cc=jasowang@redhat$(echo .)com \
--cc=kvm@vger$(echo .)kernel.org \
--cc=linux-kernel@vger$(echo .)kernel.org \
--cc=mst@redhat$(echo .)com \
--cc=netdev@vger$(echo .)kernel.org \
--cc=stable@vger$(echo .)kernel.org \
--cc=virtualization@lists$(echo .)linux-foundation.org \
--cc=xianting.tian@linux$(echo .)alibaba.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox