mirror of
https://github.com/freebsd/freebsd-src
synced 2024-10-15 12:54:27 +00:00
ata(4): Release the ioport resource if device initialization fails
PR: 251346 Submitted by: janm@transactionware.com MFC after: 1 week
This commit is contained in:
parent
78e1f68ee1
commit
938a9d7c4f
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=367989
|
@ -111,8 +111,12 @@ ata_pci_attach(device_t dev)
|
|||
RF_ACTIVE);
|
||||
}
|
||||
|
||||
if (ctlr->chipinit(dev))
|
||||
if (ctlr->chipinit(dev)) {
|
||||
if (ctlr->r_res1)
|
||||
bus_release_resource(dev, ctlr->r_type1, ctlr->r_rid1,
|
||||
ctlr->r_res1);
|
||||
return ENXIO;
|
||||
}
|
||||
|
||||
/* attach all channels on this controller */
|
||||
for (unit = 0; unit < ctlr->channels; unit++) {
|
||||
|
|
Loading…
Reference in a new issue