svn commit: r285055 - head/sys/kern

Mateusz Guzik mjg at FreeBSD.org
Thu Jul 2 19:00:22 UTC 2015


Author: mjg
Date: Thu Jul  2 19:00:22 2015
New Revision: 285055
URL: https://svnweb.freebsd.org/changeset/base/285055

Log:
  sysvshm: fix shmrealloc
  
  The code was supposed to initialize new segs in newsegs array, but used the old
  pointer.

Modified:
  head/sys/kern/sysv_shm.c

Modified: head/sys/kern/sysv_shm.c
==============================================================================
--- head/sys/kern/sysv_shm.c	Thu Jul  2 18:30:12 2015	(r285054)
+++ head/sys/kern/sysv_shm.c	Thu Jul  2 19:00:22 2015	(r285055)
@@ -801,10 +801,10 @@ shmrealloc(void)
 	for (i = 0; i < shmalloced; i++)
 		bcopy(&shmsegs[i], &newsegs[i], sizeof(newsegs[0]));
 	for (; i < shminfo.shmmni; i++) {
-		shmsegs[i].u.shm_perm.mode = SHMSEG_FREE;
-		shmsegs[i].u.shm_perm.seq = 0;
+		newsegs[i].u.shm_perm.mode = SHMSEG_FREE;
+		newsegs[i].u.shm_perm.seq = 0;
 #ifdef MAC
-		mac_sysvshm_init(&shmsegs[i]);
+		mac_sysvshm_init(&newsegs[i]);
 #endif
 	}
 	free(shmsegs, M_SHM);


More information about the svn-src-head mailing list