HomeFreeBSD

linuxkpi: Fix an off-by-one error in the kfifo implementation

Description

linuxkpi: Fix an off-by-one error in the kfifo implementation

"total" is the number of slots in the array, so wraparound needs to be
done when "first" or "last" is greater than or equal to the number of
slots.

Note that no consumers of the code are currently connected to the kernel
build.

Reported by: Stanislav Fort <stanislav.fort@aisle.com>
Reviewed by: bz, emaste
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D56371

(cherry picked from commit 52d2fc702b85d56b35f8828fe7efca3cde0d25b7)

Details

Provenance
markjAuthored on Apr 15 2026, 1:33 PM
Reviewer
bz
Differential Revision
D56371: linuxkpi: Fix an off-by-one error in the kfifo implementation
Parents
rG12e61434db07: in_mcast: Fix a lock leak in inp_set_source_filters()
Branches
Unknown
Tags
Unknown