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:
Pavel Boldin 2015-03-23 14:53:45 +02:00 committed by Thomas Monjalon
parent 5c561b0a23
commit 38f4f01f8f

View File

@ -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;