From: Pavel Boldin Date: Mon, 23 Mar 2015 12:53:45 +0000 (+0200) Subject: vhost: fix file struct leakage X-Git-Tag: spdx-start~9378 X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=38f4f01f8fe7aba72f858fd6faa0126edc645fe1;p=dpdk.git 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 Acked-by: Huawei Xie --- diff --git a/lib/librte_vhost/eventfd_link/eventfd_link.c b/lib/librte_vhost/eventfd_link/eventfd_link.c index 7755dd6737..62c45c8da0 100644 --- a/lib/librte_vhost/eventfd_link/eventfd_link.c +++ b/lib/librte_vhost/eventfd_link/eventfd_link.c @@ -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;