Fix error checking in shm_create_largepage().

Reviewed by:	alc, kib
Reported by:	Coverity
MFC with:	r365524
Differential Revision:	https://reviews.freebsd.org/D26464
This commit is contained in:
Mark Johnston 2020-09-18 12:30:15 +00:00
parent 72f97a2d09
commit 3d1098617b

View File

@ -65,7 +65,7 @@ shm_create_largepage(const char *path, int flags, int psind, int alloc_policy,
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));