Linux-HyperV List
 help / color / mirror / Atom feed
* [PATCH] mshv: fix fd leak in mshv_ioctl_create_vtl()
@ 2026-07-08  1:28 Yi Xie
  2026-07-08  1:42 ` sashiko-bot
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Yi Xie @ 2026-07-08  1:28 UTC (permalink / raw)
  To: kys, haiyangz, wei.liu; +Cc: linux-hyperv, linux-kernel, Yi Xie

put_unused_fd() if anon_inode_getfile() fails.

Signed-off-by: Yi Xie <xieyi@kylinos.cn>
---
 drivers/hv/mshv_vtl_main.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/hv/mshv_vtl_main.c b/drivers/hv/mshv_vtl_main.c
index 0d3d4161974f..897a41b08d02 100644
--- a/drivers/hv/mshv_vtl_main.c
+++ b/drivers/hv/mshv_vtl_main.c
@@ -129,6 +129,7 @@ mshv_ioctl_create_vtl(void __user *user_arg, struct device *module_dev)
 	file = anon_inode_getfile("mshv_vtl", &mshv_vtl_fops,
 				  vtl, O_RDWR);
 	if (IS_ERR(file)) {
+		put_unused_fd(fd);
 		kfree(vtl);
 		return PTR_ERR(file);
 	}
-- 
2.34.1

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

end of thread, other threads:[~2026-07-09 16:05 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-07-08  1:28 [PATCH] mshv: fix fd leak in mshv_ioctl_create_vtl() Yi Xie
2026-07-08  1:42 ` sashiko-bot
2026-07-08 13:05 ` Hamza Mahfooz
2026-07-09 16:05 ` Markus Elfring

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox