LinuxKPI: Invoke release handler when file is destroyed by fput()

Required by drm_kmod 5.6

Reviewed by:	hselasky, manu
MFC after:	2 weeks
Differential revision:	https://reviews.freebsd.org/D32067
This commit is contained in:
Vladimir Kondratyev 2021-09-29 23:13:27 +03:00
parent 2fe9ea5d3a
commit 7d92d48358

View File

@ -471,6 +471,8 @@ void
linux_file_free(struct linux_file *filp)
{
if (filp->_file == NULL) {
if (filp->f_op != NULL && filp->f_op->release != NULL)
filp->f_op->release(filp->f_vnode, filp);
if (filp->f_shmem != NULL)
vm_object_deallocate(filp->f_shmem);
kfree_rcu(filp, rcu);