vhost: fix file struct leakage
Due to increased `struct file's reference counter subsequent call to `filp_close' does not free the `struct file'. Prepend `fput' call to decrease the reference counter. Signed-off-by: Pavel Boldin <pboldin@mirantis.com> Acked-by: Huawei Xie <huawei.xie@intel.com>
This commit is contained in:
parent
5c561b0a23
commit
38f4f01f8f
@ -117,6 +117,7 @@ eventfd_link_ioctl(struct file *f, unsigned int ioctl, unsigned long arg)
|
||||
* Release the existing eventfd in the source process
|
||||
*/
|
||||
spin_lock(&files->file_lock);
|
||||
fput(file);
|
||||
filp_close(file, files);
|
||||
fdt = files_fdtable(files);
|
||||
fdt->fd[eventfd_copy.source_fd] = NULL;
|
||||
|
Loading…
Reference in New Issue
Block a user