git: 7a88ac783b97 - stable/14 - dpaa2_mc: Check for error the first time bus_generic_detach is called
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Thu, 27 Feb 2025 16:55:51 UTC
The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=7a88ac783b97acf59209a96eae49f367b0afefad commit 7a88ac783b97acf59209a96eae49f367b0afefad Author: John Baldwin <jhb@FreeBSD.org> AuthorDate: 2024-11-05 01:30:53 +0000 Commit: John Baldwin <jhb@FreeBSD.org> CommitDate: 2025-02-27 15:17:57 +0000 dpaa2_mc: Check for error the first time bus_generic_detach is called This removes the need for the second call. Reviewed by: dsl Differential Revision: https://reviews.freebsd.org/D47388 (cherry picked from commit 24d5a8e6eec2b9eed9591971f223d79b8d7044c9) --- sys/dev/dpaa2/dpaa2_mc.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/sys/dev/dpaa2/dpaa2_mc.c b/sys/dev/dpaa2/dpaa2_mc.c index a6b56be10432..792745a535b3 100644 --- a/sys/dev/dpaa2/dpaa2_mc.c +++ b/sys/dev/dpaa2/dpaa2_mc.c @@ -281,7 +281,9 @@ dpaa2_mc_detach(device_t dev) struct dpaa2_devinfo *dinfo = NULL; int error; - bus_generic_detach(dev); + error = bus_generic_detach(dev); + if (error != 0) + return (error); sc = device_get_softc(dev); if (sc->rcdev) @@ -292,10 +294,6 @@ dpaa2_mc_detach(device_t dev) if (dinfo) free(dinfo, M_DPAA2_MC); - error = bus_generic_detach(dev); - if (error != 0) - return (error); - return (device_delete_children(dev)); }