LibBSD | sys/kern/kern_event.c: Fix kqueue double hold (!71)
Aaron Nyholm (@eagleirony)
gitlab at rtems.org
Tue May 27 22:12:48 UTC 2025
Aaron Nyholm commented on a discussion on freebsd/sys/kern/kern_event.c: https://gitlab.rtems.org/rtems/pkg/rtems-libbsd/-/merge_requests/71#note_122904
> if (ffd < 0)
> error = EBADF;
> else {
> - if (iop == NULL)
> + if (iop == NULL) {
> error = fget(td, ffd, &cap_event_rights, &fp);
> - else
> + if (!error) {
> + rtems_bsd_libio_iop_drop(kev->ident);
> + }
This issue is specific to Kqueue as it handles both RTEMS files and Freebsd files. It doesn't need to be replicated elsewhere as the issue is specific to kqueue handling both Freebsd and RTEMS files. This section should only hold the `iop` once but does so twice for Freebsd files. The first hold is `rtems_bsd_libio_iop_hold` which is done for both Freebsd and RTEMS files. Then `fget` also holds the `iop` for Freebsd files. This just corrects that count.
--
View it on GitLab: https://gitlab.rtems.org/rtems/pkg/rtems-libbsd/-/merge_requests/71#note_122904
You're receiving this email because of your account on gitlab.rtems.org.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rtems.org/pipermail/bugs/attachments/20250527/43f4e733/attachment-0001.htm>
More information about the bugs
mailing list