Skip to content

Commit

Permalink
px4_kmmap.c: Fix file pointer reference counter handling after NuttX …
Browse files Browse the repository at this point in the history
…update

Signed-off-by: Jukka Laitinen <[email protected]>
  • Loading branch information
jlaitine committed Oct 1, 2024
1 parent 53daf7c commit b3324b9
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions platforms/nuttx/src/px4/common/px4_kmmap.c
Original file line number Diff line number Diff line change
Expand Up @@ -83,11 +83,13 @@ void *px4_mmap(void *start, size_t length, int prot, int flags, int fd, off_t of

filep->f_inode->i_crefs++;
inode_unlock();
fs_putfilep(filep);
return vaddr;

errout_with_lock:
inode_unlock();
errout:
fs_putfilep(filep);
set_errno(-ret);
return MAP_FAILED;
}
Expand Down

0 comments on commit b3324b9

Please sign in to comment.