Page MenuHomeFreeBSD

bus: Return 0 if reading an ivar fails
ClosedPublic

Authored by des on Thu, Dec 4, 9:01 PM.
Tags
None
Referenced Files
Unknown Object (File)
Wed, Dec 10, 1:40 PM
Unknown Object (File)
Tue, Dec 9, 7:23 PM
Unknown Object (File)
Mon, Dec 8, 6:42 AM
Unknown Object (File)
Mon, Dec 8, 1:49 AM
Unknown Object (File)
Sun, Dec 7, 8:41 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.Thu, Dec 4, 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.Fri, Dec 5, 1:16 PM
This revision was automatically updated to reflect the committed changes.