Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 2 Jul 2015 19:00:22 +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: r285055 - head/sys/kern
Message-ID:  <201507021900.t62J0Moe028290@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
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);



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