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;
 }
_______________________________________________
[email protected] mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "[email protected]"

Reply via email to