Add clean up on failure and a detach function to the pci host generic
driver.
Details
- Reviewers
jhb - Group Reviewers
ARM arm64 riscv - Commits
- rG2069f112f007: Clean up in the pci host generic driver
rGd843dd0e1add: Clean up in the pci host generic driver
Diff Detail
- Repository
- rS FreeBSD src repository - subversion
- Lint
Lint Passed - Unit
No Test Coverage - Build Status
Buildable 45672 Build 42560: arc lint + arc unit
Event Timeline
sys/dev/pci/pci_host_generic.c | ||
---|---|---|
169 | Is there any reason that you went with this style over what other drivers do with testing pointers, etc in a generic release routine? |
sys/dev/pci/pci_host_generic.c | ||
---|---|---|
169 | rman_fini is dangerous as it locks rm->rm_mtx. This is allocated via malloc so may be a NULL pointer dereference if rman_init hasn't been called. We could check on rm->rm_mtx, but that feels like it's too much knowledge of the internals that may change. |
sys/dev/pci/pci_host_generic.c | ||
---|---|---|
566 | Given that this driver has no probe method, I assume it's used as a base class for other drivers and not instantiated directly. In that case, are these attach/detach methods ever used or do child classes always define custom methods that call these routines? (For example, I see now calls to bus_generic_attach or bus_generic_detach, so it seems unlikely these routines can be used for attach/detach as-is). If they are always used in custom methods, I think it makes sense to not define device_attach and device_detach in this method list at all. |