diff options
author | Gordon Tetlow <gordon@FreeBSD.org> | 2020-07-08 19:57:24 +0000 |
---|---|---|
committer | Gordon Tetlow <gordon@FreeBSD.org> | 2020-07-08 19:57:24 +0000 |
commit | 7d6660ece9f65b99527ab1d65414f86160b39760 (patch) | |
tree | 5f0a6f543ae80a931906890111e928bc2ec684f4 | |
parent | 180f40586fad8b4f35a9d5d39aab96786f9c9dd0 (diff) |
Fix kernel panic in LinuxKPI subsystem.
Approved by: so
Security: FreeBSD-EN-20:14.linuxpki
Notes
Notes:
svn path=/releng/11.3/; revision=363023
-rw-r--r-- | sys/compat/linuxkpi/common/src/linux_compat.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/sys/compat/linuxkpi/common/src/linux_compat.c b/sys/compat/linuxkpi/common/src/linux_compat.c index ef6e01864434..3795dd478b68 100644 --- a/sys/compat/linuxkpi/common/src/linux_compat.c +++ b/sys/compat/linuxkpi/common/src/linux_compat.c @@ -1502,6 +1502,9 @@ linux_file_close(struct file *file, struct thread *td) KASSERT(file_count(filp) == 0, ("File refcount(%d) is not zero", file_count(filp))); + if (td == NULL) + td = curthread; + error = 0; filp->f_flags = file->f_flag; linux_set_current(td); |