diff options
author | Mark Johnston <markj@FreeBSD.org> | 2020-09-18 12:30:15 +0000 |
---|---|---|
committer | Mark Johnston <markj@FreeBSD.org> | 2020-09-18 12:30:15 +0000 |
commit | 3d1098617b81300ef215f02e3d967147aed03bb0 (patch) | |
tree | 4c58b0397b666ca649142ad24dd1de21a15f631c | |
parent | 72f97a2d0934a0c72b9c485656f6d1456098b8ef (diff) | |
download | src-3d1098617b81300ef215f02e3d967147aed03bb0.tar.gz src-3d1098617b81300ef215f02e3d967147aed03bb0.zip |
Fix error checking in shm_create_largepage().
Reviewed by: alc, kib
Reported by: Coverity
MFC with: r365524
Differential Revision: https://reviews.freebsd.org/D26464
Notes
Notes:
svn path=/head/; revision=365877
-rw-r--r-- | lib/libc/sys/shm_open.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/libc/sys/shm_open.c b/lib/libc/sys/shm_open.c index c7020fd76c3c..e5666a3558e9 100644 --- a/lib/libc/sys/shm_open.c +++ b/lib/libc/sys/shm_open.c @@ -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)); |