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
Unknown Object (File)
Tue, Nov 4, 3:06 AM
Unknown Object (File)
Wed, Oct 29, 2:38 PM
Unknown Object (File)
Wed, Oct 29, 2:37 PM
Unknown Object (File)
Sat, Oct 25, 10:25 PM
Unknown Object (File)
Oct 24 2025, 5:16 PM
Unknown Object (File)
Oct 19 2025, 3:18 AM
Unknown Object (File)
Oct 18 2025, 2:29 PM
Unknown Object (File)
Sep 18 2025, 6:46 AM
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 Not Applicable
Unit
Tests Not Applicable