Page MenuHomeFreeBSD

bus: Return 0 if reading an ivar fails
ClosedPublic

Authored by des on Dec 4 2025, 9:01 PM.
Tags
None
Referenced Files
Unknown Object (File)
Tue, Dec 23, 10:48 PM
Unknown Object (File)
Dec 18 2025, 9:18 PM
Unknown Object (File)
Dec 17 2025, 8:08 PM
Unknown Object (File)
Dec 17 2025, 6:24 AM
Unknown Object (File)
Dec 16 2025, 10:09 AM
Unknown Object (File)
Dec 10 2025, 1:40 PM
Unknown Object (File)
Dec 9 2025, 7:23 PM
Unknown Object (File)
Dec 8 2025, 6:42 AM
Subscribers

Details

Summary

In the non-INVARIANTS case, return 0 rather than stack garbage if
reading an ivar fails (in the INVARIANTS case, we still panic).

MFC after: 1 week
Sponsored by: Klara, Inc.
Sponsored by: NetApp, Inc.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

des requested review of this revision.Dec 4 2025, 9:01 PM

Hmmm, I wonder if 0 is the right thing vs something like 0xdeadc0de. We have a few explicit IVAR handlers that intentionally return a default value (e.g. acpi_get_handle()) and those do tend to be zero (and in those cases we don't KASSERT). I have a patch in a branch to add a new one like that for ThunderBolt PCI bridges even. 0 is probably fine as a default, but @imp might also have an opinion.

This revision is now accepted and ready to land.Dec 5 2025, 1:16 PM
This revision was automatically updated to reflect the committed changes.