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
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=317311
@ -87,6 +87,8 @@ geom_stats_open(void)
|
|||||||
if (statsfd < 0)
|
if (statsfd < 0)
|
||||||
return (errno);
|
return (errno);
|
||||||
pagesize = getpagesize();
|
pagesize = getpagesize();
|
||||||
|
if (pagesize == -1)
|
||||||
|
return (errno);
|
||||||
spp = pagesize / sizeof(struct devstat);
|
spp = pagesize / sizeof(struct devstat);
|
||||||
p = mmap(NULL, pagesize, PROT_READ, MAP_SHARED, statsfd, 0);
|
p = mmap(NULL, pagesize, PROT_READ, MAP_SHARED, statsfd, 0);
|
||||||
if (p == MAP_FAILED) {
|
if (p == MAP_FAILED) {
|
||||||
|
Loading…
Reference in New Issue
Block a user