HomeFreeBSD

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

Description

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

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
Reviewed by: dumbbell
Differential Revision: https://reviews.freebsd.org/D50154

Details

Provenance
bzAuthored on May 4 2025, 7:58 PM
Reviewer
dumbbell
Differential Revision
D50154: LinuxKPI: pci: deal with kobject_add() being able to fail
Parents
rG8414a2e9caa0: committers-src: add myself (khorben@) with philip@ as mentor
Branches
Unknown
Tags
Unknown