svn commit: r356987 - stable/11/sys/compat/linuxkpi/common/src

Mark Johnston markj at FreeBSD.org
Wed Jan 22 15:51:25 UTC 2020


Author: markj
Date: Wed Jan 22 15:51:24 2020
New Revision: 356987
URL: https://svnweb.freebsd.org/changeset/base/356987

Log:
  MFC r356760:
  Handle a NULL thread pointer in linux_close_file().
  
  PR:	242913

Modified:
  stable/11/sys/compat/linuxkpi/common/src/linux_compat.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/compat/linuxkpi/common/src/linux_compat.c
==============================================================================
--- stable/11/sys/compat/linuxkpi/common/src/linux_compat.c	Wed Jan 22 15:06:59 2020	(r356986)
+++ stable/11/sys/compat/linuxkpi/common/src/linux_compat.c	Wed Jan 22 15:51:24 2020	(r356987)
@@ -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);


More information about the svn-src-all mailing list