Page MenuHomeFreeBSD

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

Authored by bz on Sun, May 4, 10:04 PM.
Tags
None
Referenced Files
Unknown Object (File)
Fri, May 23, 4:58 AM
Unknown Object (File)
Fri, May 16, 5:46 AM
Unknown Object (File)
Sun, May 11, 9:04 AM
Unknown Object (File)
Fri, May 9, 8:06 PM
Unknown Object (File)
Fri, May 9, 4:05 PM
Unknown Object (File)
Tue, May 6, 8:05 AM
Unknown Object (File)
Tue, May 6, 4:58 AM
Unknown Object (File)
Tue, May 6, 2:00 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