Module Name: src Committed By: snj Date: Thu Dec 21 21:50:16 UTC 2017
Modified Files: src/sys/dev [netbsd-8]: fss.c Log Message: Pull up following revision(s) (requested by pgoyette in ticket #453): sys/dev/fss.c: revision 1.100 If config_cfattach_detach() returns an error, handle it instead of ignoring. Otherwise the mutex will get destroyed and we'll unload the module, and any active users will eventually cause a panic. Noted by code inspection. To generate a diff of this commit: cvs rdiff -u -r1.98 -r1.98.2.1 src/sys/dev/fss.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/sys/dev/fss.c diff -u src/sys/dev/fss.c:1.98 src/sys/dev/fss.c:1.98.2.1 --- src/sys/dev/fss.c:1.98 Thu Jun 1 02:45:09 2017 +++ src/sys/dev/fss.c Thu Dec 21 21:50:16 2017 @@ -1,4 +1,4 @@ -/* $NetBSD: fss.c,v 1.98 2017/06/01 02:45:09 chs Exp $ */ +/* $NetBSD: fss.c,v 1.98.2.1 2017/12/21 21:50:16 snj Exp $ */ /*- * Copyright (c) 2003 The NetBSD Foundation, Inc. @@ -36,7 +36,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: fss.c,v 1.98 2017/06/01 02:45:09 chs Exp $"); +__KERNEL_RCSID(0, "$NetBSD: fss.c,v 1.98.2.1 2017/12/21 21:50:16 snj Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -1322,7 +1322,14 @@ fss_modcmd(modcmd_t cmd, void *arg) &fss_cdevsw, &fss_cmajor); break; } - config_cfdriver_detach(&fss_cd); + error = config_cfdriver_detach(&fss_cd); + if (error) { + devsw_attach(fss_cd.cd_name, + &fss_bdevsw, &fss_bmajor, &fss_cdevsw, &fss_cmajor); + devsw_attach(fss_cd.cd_name, &fss_bdevsw, &fss_bmajor, + &fss_cdevsw, &fss_cmajor); + break; + } mutex_destroy(&fss_device_lock); break;