Skip to content

Commit

Permalink
Merge pull request #1556 from hjelmn/opal_coverity
Browse files Browse the repository at this point in the history
memory/patcher: fix coverity warning
  • Loading branch information
hjelmn committed Apr 18, 2016
2 parents 1c62188 + 7f27117 commit 95c06cf
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion opal/mca/memory/patcher/memory_patcher_component.c
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,9 @@ static size_t memory_patcher_get_shm_seg_size (const void *shmaddr)
seg_size = 0;

fd = open ("/proc/self/maps", O_RDONLY);
assert (fd >= 0);
if (fd < 0) {
return 0;
}

for (size_t read_offset = 0 ; ; ) {
ssize_t nread = read(fd, buffer + read_offset, sizeof(buffer) - 1 - read_offset);
Expand Down

0 comments on commit 95c06cf

Please sign in to comment.