Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 1 Dec 2020 15:01:11 +0000 (UTC)
From:      Mark Johnston <markj@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org
Subject:   svn commit: r368230 - stable/12/sys/dev/ata
Message-ID:  <202012011501.0B1F1Bdv025856@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
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++) {



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202012011501.0B1F1Bdv025856>