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)
Sat, Jun 20, 7:06 PM
Unknown Object (File)
Sat, Jun 20, 7:01 PM
Unknown Object (File)
Sat, Jun 20, 4:59 PM
Unknown Object (File)
Sat, Jun 20, 10:32 AM
Unknown Object (File)
Thu, Jun 18, 7:07 PM
Unknown Object (File)
Thu, Jun 18, 7:05 PM
Unknown Object (File)
Mon, Jun 15, 1:39 PM
Unknown Object (File)
Mon, Jun 15, 1:19 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 74087
Build 70970: 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–669

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

sys/compat/linuxkpi/common/src/linux_pci.c
650–669

That was certainly no planned. I'll do the 8>>

Properly indent comment and put it under the first label.

bz marked an inline comment as done.Sun, Jun 21, 9:11 PM