Page MenuHomeFreeBSD

rtlbtfw: handle partial reads when loading firmware
AbandonedPublic

Authored by longros on Apr 18 2026, 11:44 AM.
Tags
None
Referenced Files
F175522548: D56500.diff
Sun, Oct 11, 10:46 AM
Unknown Object (File)
Thu, Oct 1, 8:11 PM
Unknown Object (File)
Mon, Sep 28, 1:49 PM
Unknown Object (File)
Thu, Sep 24, 6:55 AM
Unknown Object (File)
Thu, Sep 24, 4:43 AM
Unknown Object (File)
Sat, Sep 19, 4:43 PM
Unknown Object (File)
Sat, Sep 19, 4:43 PM
Unknown Object (File)
Fri, Sep 18, 11:17 PM
Subscribers

Details

Reviewers
wulf
Summary

Loop until all bytes are read or a real error occurs, instead of
assuming a single read() returns the entire file. Retry on EINTR
and break on EOF. Use intmax_t casts in the error message to
match off_t portably.

Signed-off-by: Christos Longros

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 72321
Build 69204: arc lint + arc unit

Event Timeline

Although it looks good, replacing read() with mmap() -> memcpy() -> munmap() sequence would make code simpler and cleaner

I was working on the changes, but thanks for implementing them :)