Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 20 Oct 2016 19:55:50 +0000 (UTC)
From:      Mateusz Guzik <mjg@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r307685 - head/sys/kern
Message-ID:  <201610201955.u9KJtoGf067050@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: mjg
Date: Thu Oct 20 19:55:50 2016
New Revision: 307685
URL: https://svnweb.freebsd.org/changeset/base/307685

Log:
  cache: fix up a corner case in r307650
  
  If no negative entry is found on the last list, the ncp pointer will be
  left uninitialized and a non-null value will make the function assume an
  entry was found.
  
  Fix the problem by initializing to NULL on entry.
  
  Reported by:	glebius

Modified:
  head/sys/kern/vfs_cache.c

Modified: head/sys/kern/vfs_cache.c
==============================================================================
--- head/sys/kern/vfs_cache.c	Thu Oct 20 19:42:26 2016	(r307684)
+++ head/sys/kern/vfs_cache.c	Thu Oct 20 19:55:50 2016	(r307685)
@@ -763,6 +763,8 @@ cache_negative_shrink_select(int start, 
 	struct namecache *ncp;
 	int i;
 
+	*ncpp = ncp = NULL;
+
 	for (i = start; i < numneglists; i++) {
 		neglist = &neglists[i];
 		if (TAILQ_FIRST(&neglist->nl_list) == NULL)



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201610201955.u9KJtoGf067050>