diff options
| author | Yi Xie <xieyi@kylinos.cn> | 2026-07-08 09:28:52 +0800 |
|---|---|---|
| committer | Wei Liu <wei.liu@kernel.org> | 2026-07-22 23:51:09 +0000 |
| commit | ec08dd5b9ffa52980908805bdc8a55a8f1bc6667 (patch) | |
| tree | 2e25fa93b2a057644bb7546848d1d33b8021a4b9 | |
| parent | b496f042e0da26dd673806870c204adfe697f169 (diff) | |
mshv_vtl: fix fd leak in mshv_ioctl_create_vtl()
put_unused_fd() if anon_inode_getfile() fails.
Fixes: 7bfe3b8ea6e30 ("Drivers: hv: Introduce mshv_vtl driver")
Signed-off-by: Yi Xie <xieyi@kylinos.cn>
Reviewed-by: Hamza Mahfooz <hamzamahfooz@linux.microsoft.com>
Signed-off-by: Wei Liu <wei.liu@kernel.org>
| -rw-r--r-- | drivers/hv/mshv_vtl_main.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/hv/mshv_vtl_main.c b/drivers/hv/mshv_vtl_main.c index dbf03b6676cd..5ba1efb3b4e7 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); } |
