Page MenuHomeFreeBSD

LinuxKPI: pci: cleanup the error path in linux_pci_attach_device()
Needs ReviewPublic

Authored by bz on Thu, Jun 4, 9:36 AM.
Tags
None
Referenced Files
Unknown Object (File)
Thu, Jun 11, 1:19 AM
Unknown Object (File)
Wed, Jun 10, 4:52 PM
Unknown Object (File)
Tue, Jun 9, 11:42 AM
Unknown Object (File)
Tue, Jun 9, 10:27 AM
Unknown Object (File)
Mon, Jun 8, 10:28 PM
Unknown Object (File)
Mon, Jun 8, 9:27 PM
Unknown Object (File)
Sun, Jun 7, 12:37 PM
Subscribers

Details

Reviewers
None
Group Reviewers
linuxkpi
Summary

Very much like the cleanup done for the detach call, try to address a
comment left behind and cleanup all the resources allocated in case
of error during attach. This is slightly less complex than
lkpi_pci_dev_release() as some of the lists cannot yet hold allocated
resources so we can skip this.

While this mostly a copy of lkpi_pci_dev_release(), we could possibly
call pci_put_dev() in any case and be done and let the (*release)
function do its job. However there are some uncertainties still
(see other comments) which would prevent us doing so. Punt for the
moment and leave a comment and revisit once more work on the cleanup
paths has finished.

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 73657
Build 70540: arc lint + arc unit

Event Timeline

bz requested review of this revision.Thu, Jun 4, 9:36 AM
sys/compat/linuxkpi/common/src/linux_pci.c
650–657

I'm not sure what style(9) has to say, but this unindented comment gave me the impression that a new function started here.