HomeFreeBSD

cam: Let cam_periph_unmapmem() return an error

Description

cam: Let cam_periph_unmapmem() return an error

As of commit b059686a71c8, cam_periph_unmapmem() can legitimately fail
if the copyout() operation fails. However, this failure was never
signaled to upper layers. In practice it is unlikely to occur
since cap_periph_mapmem() would most likely fail in such
circumstances anyway, but an error is nonetheless possible.

However, some code reading revealed a few paths where the return value
of cam_periph_mapmem() is not checked, and this is definitely a bug.
Add error checking there and let cam_periph_unmapmem() return errors
from copyout().

Reviewed by: dab, mav
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D43201

Details

Provenance
markjAuthored on Dec 28 2023, 5:08 PM
Reviewer
dab
Differential Revision
D43201: cam: Let cam_periph_unmapmem() return an error
Parents
rG23699ff23c36: Revert "vtnet: Adjust rx buffer so IP header 32-bit aligned"
Branches
Unknown
Tags
Unknown