git: d56c7ac87f9f - main - dpaa: Go to cleanup exit point on fman attach error
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Sun, 06 Nov 2022 00:02:48 UTC
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));