Skip to content

Commit

Permalink
Remove invalid call to munmap in fd_shmem_join
Browse files Browse the repository at this point in the history
The call to `munmap` is invalid as it will only be called when
`shmem` is set to `MAP_FAILED`. This is not a valid userspace address
and `munmap` will fail every time.
  • Loading branch information
Fire30 authored and ptaffet-jump committed Nov 20, 2023
1 parent 81dcdef commit 059512c
Showing 1 changed file with 0 additions and 3 deletions.
3 changes: 0 additions & 3 deletions src/util/shmem/fd_shmem_user.c
Original file line number Diff line number Diff line change
Expand Up @@ -154,9 +154,6 @@ fd_shmem_join( char const * name,
/* Validate the mapping */

if( FD_UNLIKELY( shmem==MAP_FAILED ) ) {
if( FD_UNLIKELY( munmap( shmem, sz ) ) )
FD_LOG_WARNING(( "munmap(\"%s\",%lu KiB) failed (%i-%s); attempting to continue",
path, sz>>10, errno, fd_io_strerror( errno ) ));
FD_SHMEM_UNLOCK;
FD_LOG_WARNING(( "mmap(NULL,%lu KiB,%s,MAP_SHARED,\"%s\",0) failed (%i-%s)",
sz>>10, rw ? "PROT_READ|PROT_WRITE" : "PROT_READ", path, mmap_errno, fd_io_strerror( mmap_errno ) ));
Expand Down

0 comments on commit 059512c

Please sign in to comment.