svn commit: r368230 - stable/12/sys/dev/ata

Mark Johnston markj at FreeBSD.org
Tue Dec 1 15:01:11 UTC 2020


Author: markj
Date: Tue Dec  1 15:01:10 2020
New Revision: 368230
URL: https://svnweb.freebsd.org/changeset/base/368230

Log:
  MFC r367989:
  ata(4): Release the ioport resource if device initialization fails
  
  PR:	251346

Modified:
  stable/12/sys/dev/ata/ata-pci.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sys/dev/ata/ata-pci.c
==============================================================================
--- stable/12/sys/dev/ata/ata-pci.c	Tue Dec  1 13:58:14 2020	(r368229)
+++ stable/12/sys/dev/ata/ata-pci.c	Tue Dec  1 15:01:10 2020	(r368230)
@@ -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++) {


More information about the svn-src-stable mailing list