aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGordon Tetlow <gordon@FreeBSD.org>2020-07-08 19:57:24 +0000
committerGordon Tetlow <gordon@FreeBSD.org>2020-07-08 19:57:24 +0000
commite268defb43a8d584e5f116ffb2054df91d9c91af (patch)
treed90c0eaa8803eb1d39d466b633ab0cb23e79aee0
parente4036fcd5ef9ac8760b24715745c65d7d7529a11 (diff)
downloadsrc-e268defb43a8d584e5f116ffb2054df91d9c91af.tar.gz
src-e268defb43a8d584e5f116ffb2054df91d9c91af.zip
Fix kernel panic in LinuxKPI subsystem.
Approved by: so Security: FreeBSD-EN-20:14.linuxpki
Notes
Notes: svn path=/releng/12.1/; revision=363023
-rw-r--r--sys/compat/linuxkpi/common/src/linux_compat.c3
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 b7c1cc36b8d6..56c747864534 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);