Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 22 Mar 2014 22:35:58 +0000 (UTC)
From:      Neel Natu <neel@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r263651 - head/sys/kern
Message-ID:  <201403222235.s2MMZwt7043584@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: neel
Date: Sat Mar 22 22:35:57 2014
New Revision: 263651
URL: http://svnweb.freebsd.org/changeset/base/263651

Log:
  Don't lose track of the KTR entries copied from 'ktr_buf_init[]' to the
  dynamically allocated 'ktr_buf[]'.
  
  The memcpy arranges 'ktr_buf[]' such that the latest KTR entry is at
  'KTR_BOOT_ENTRIES - 1'.

Modified:
  head/sys/kern/kern_ktr.c

Modified: head/sys/kern/kern_ktr.c
==============================================================================
--- head/sys/kern/kern_ktr.c	Sat Mar 22 22:20:43 2014	(r263650)
+++ head/sys/kern/kern_ktr.c	Sat Mar 22 22:35:57 2014	(r263651)
@@ -212,9 +212,11 @@ ktr_entries_initializer(void *dummy __un
 	    M_WAITOK | M_ZERO);
 	memcpy(ktr_buf, ktr_buf_init + ktr_idx,
 	    (KTR_BOOT_ENTRIES - ktr_idx) * sizeof(*ktr_buf));
-	if (ktr_idx != 0)
+	if (ktr_idx != 0) {
 		memcpy(ktr_buf + KTR_BOOT_ENTRIES - ktr_idx, ktr_buf_init,
 		    ktr_idx * sizeof(*ktr_buf));
+		ktr_idx = KTR_BOOT_ENTRIES;
+	}
 	ktr_entries = KTR_ENTRIES;
 	ktr_mask = mask;
 }



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