Page MenuHomeFreeBSD

LinuxKPI: pci: deal with kobject_add() being able to fail
ClosedPublic

Authored by bz on May 4 2025, 10:04 PM.
Tags
None
Referenced Files
F163465759: D50154.id154810.diff
Thu, Jul 23, 10:23 AM
Unknown Object (File)
Wed, Jul 22, 12:23 PM
Unknown Object (File)
Sun, Jul 19, 8:36 PM
Unknown Object (File)
Sun, Jul 19, 7:44 PM
Unknown Object (File)
Jun 22 2026, 4:01 PM
Unknown Object (File)
May 11 2026, 7:46 PM
Unknown Object (File)
May 11 2026, 7:46 PM
Unknown Object (File)
May 11 2026, 7:38 PM
Subscribers

Details

Summary

lkpifill_pci_dev() uses a sequene of kobject_init/set_name/add.
The problem is that kobject_add could fail.

Move the entire logic to the beginning of the function,
switch to kobject_init_and_add() and check the return code.
Make lkpifill_pci_dev() return the error and deal in the callers
with a possible error accordingly.

Sponsored by: The FreeBSD Foundation
MFC after: 3 days

Diff Detail

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