linuxkpi: copy ldev into local to test and free the same pointer

Reviewed by:	hselasky
Sponsored by:	Mellanox Technologies/NVidia Networking
MFC after:	1 week
This commit is contained in:
Konstantin Belousov 2021-03-30 11:41:00 +03:00
parent d36d681615
commit 7b0125cbec
2 changed files with 2601 additions and 2 deletions

View file

@ -1520,8 +1520,9 @@ linux_file_close(struct file *file, struct thread *td)
if (filp->f_vnode != NULL)
vdrop(filp->f_vnode);
linux_drop_fop(ldev);
if (filp->f_cdev != NULL)
linux_cdev_deref(filp->f_cdev);
ldev = filp->f_cdev;
if (ldev != NULL)
linux_cdev_deref(ldev);
kfree(filp);
return (error);

File diff suppressed because it is too large Load diff