Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 6 Nov 2022 00:02:48 GMT
From:      Justin Hibbits <jhibbits@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org
Subject:   git: d56c7ac87f9f - main - dpaa: Go to cleanup exit point on fman attach error
Message-ID:  <202211060002.2A602m2I068425@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch main has been updated by jhibbits:

URL: https://cgit.FreeBSD.org/src/commit/?id=d56c7ac87f9f0fbbdc415265f56915a824a8112d

commit d56c7ac87f9f0fbbdc415265f56915a824a8112d
Author:     Justin Hibbits <jhibbits@FreeBSD.org>
AuthorDate: 2022-11-06 00:01:50 +0000
Commit:     Justin Hibbits <jhibbits@FreeBSD.org>
CommitDate: 2022-11-06 00:05:24 +0000

    dpaa: Go to cleanup exit point on fman attach error
    
    If fman_init() fails it can leave things in a state where it cannot
    attach at all in the future, because it would simply exit without
    tearing down everything that was already set up.  Go to the exit point
    to clean up on error instead, so that it can try again later.
    
    MFC after:      1 week
---
 sys/dev/dpaa/fman.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sys/dev/dpaa/fman.c b/sys/dev/dpaa/fman.c
index 64709b07fc42..738ad024b90c 100644
--- a/sys/dev/dpaa/fman.c
+++ b/sys/dev/dpaa/fman.c
@@ -473,7 +473,7 @@ fman_attach(device_t dev)
 	sc->fm_handle = fman_init(sc, &cfg);
 	if (sc->fm_handle == NULL) {
 		device_printf(dev, "could not be configured\n");
-		return (ENXIO);
+		goto err;
 	}
 
 	return (bus_generic_attach(dev));



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