HomeFreeBSD

arm64/pmap: fix pmap_is_valid_memattr()

Description

arm64/pmap: fix pmap_is_valid_memattr()

The function pmap_is_valid_memattr(pmap, mode) checks whether the
given variable mode is between the two constant values
VM_MEMATTR_DEVICE and VM_MEMATTR_WRITE_THROUGH.
After the code for this function was written, the value of
VM_MEMATTR_DEVICE changed from 0 to 4. Since VM_MEMATTR_WRITE_THROUGH
is still 3, the condition is always false.
This patch changes the condition to check whether mode is equal to any
of the VM_MEMATTR* constants.

Reviewed by: andrew, tuexen
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D55534

Details

Provenance
timo.voelker_fh-muenster.deAuthored on Mar 2 2026, 5:59 PM
tuexenCommitted on Mar 2 2026, 5:59 PM
Reviewer
andrew
Differential Revision
D55534: arm64/pmap: Modify condition of valid_memattr that cannot be true
Parents
rGb55bffeaaf9b: netinet6: Fix memory leak on auto_linklocal
Branches
Unknown
Tags
Unknown