Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/netbsd-8]: src/sys/dev Pull up following revision(s) (requested by pgoye...



details:   https://anonhg.NetBSD.org/src/rev/17478d76dffc
branches:  netbsd-8
changeset: 851242:17478d76dffc
user:      snj <snj%NetBSD.org@localhost>
date:      Thu Dec 21 21:50:16 2017 +0000

description:
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.

diffstat:

 sys/dev/fss.c |  13 ++++++++++---
 1 files changed, 10 insertions(+), 3 deletions(-)

diffs (34 lines):

diff -r 98d40cb26e29 -r 17478d76dffc sys/dev/fss.c
--- a/sys/dev/fss.c     Thu Dec 21 21:48:01 2017 +0000
+++ b/sys/dev/fss.c     Thu Dec 21 21:50:16 2017 +0000
@@ -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_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;
 



Home | Main Index | Thread Index | Old Index