svn commit: r365877 - head/lib/libc/sys

Mark Johnston markj at FreeBSD.org
Fri Sep 18 12:30:16 UTC 2020


Author: markj
Date: Fri Sep 18 12:30:15 2020
New Revision: 365877
URL: https://svnweb.freebsd.org/changeset/base/365877

Log:
  Fix error checking in shm_create_largepage().
  
  Reviewed by:	alc, kib
  Reported by:	Coverity
  MFC with:	r365524
  Differential Revision:	https://reviews.freebsd.org/D26464

Modified:
  head/lib/libc/sys/shm_open.c

Modified: head/lib/libc/sys/shm_open.c
==============================================================================
--- head/lib/libc/sys/shm_open.c	Fri Sep 18 11:22:34 2020	(r365876)
+++ head/lib/libc/sys/shm_open.c	Fri Sep 18 12:30:15 2020	(r365877)
@@ -65,7 +65,7 @@ shm_create_largepage(const char *path, int flags, int 
 	int error, fd, saved_errno;
 
 	fd = __sys_shm_open2(path, flags | O_CREAT, mode, SHM_LARGEPAGE, NULL);
-	if (error == -1)
+	if (fd == -1)
 		return (-1);
 
 	memset(&slc, 0, sizeof(slc));


More information about the svn-src-all mailing list