From d56c7ac87f9f0fbbdc415265f56915a824a8112d Mon Sep 17 00:00:00 2001 From: Justin Hibbits Date: Sat, 5 Nov 2022 20:01:50 -0400 Subject: [PATCH] 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 64709b07fc4..738ad024b90 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));