mirror of
https://github.com/torvalds/linux.git
synced 2026-09-14 16:10:02 +02:00
mshv_vtl: fix fd leak in mshv_ioctl_create_vtl()
put_unused_fd() if anon_inode_getfile() fails.
Fixes: 7bfe3b8ea6 ("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>
This commit is contained in:
parent
b496f042e0
commit
ec08dd5b9f
|
|
@ -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);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user