Check for failures from getpagesize(3)
Return errno on failure, similar to the open(2) call above it. MFC after: 5 weeks Reported by: Coverity CID: 1193753 Sponsored by: Dell EMC Isilon
This commit is contained in:
parent
ae0cf296c9
commit
2cebfa7bbf
@ -87,6 +87,8 @@ geom_stats_open(void)
|
||||
if (statsfd < 0)
|
||||
return (errno);
|
||||
pagesize = getpagesize();
|
||||
if (pagesize == -1)
|
||||
return (errno);
|
||||
spp = pagesize / sizeof(struct devstat);
|
||||
p = mmap(NULL, pagesize, PROT_READ, MAP_SHARED, statsfd, 0);
|
||||
if (p == MAP_FAILED) {
|
||||
|
Loading…
Reference in New Issue
Block a user