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

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
rGbb36c457ea49: thunderbolt: Support generic USB4 NHIs
Branches
Unknown
Tags
Unknown