Make the module return EOPNOTSUPP for unknown events.
authorPeter Avalos <pavalos@dragonflybsd.org>
Wed, 28 Nov 2007 21:29:18 +0000 (21:29 +0000)
committerPeter Avalos <pavalos@dragonflybsd.org>
Wed, 28 Nov 2007 21:29:18 +0000 (21:29 +0000)
Obtained-from: FreeBSD

sys/bus/cam/cam_periph.h
sys/bus/cam/cam_xpt.c

index e19adb4..953d402 100644 (file)
@@ -26,7 +26,7 @@
  * SUCH DAMAGE.
  *
  * $FreeBSD: src/sys/cam/cam_periph.h,v 1.6.2.1 2000/05/07 18:16:49 n_hibma Exp $
- * $DragonFly: src/sys/bus/cam/cam_periph.h,v 1.7 2007/11/17 20:28:46 pavalos Exp $
+ * $DragonFly: src/sys/bus/cam/cam_periph.h,v 1.8 2007/11/28 21:29:18 pavalos Exp $
  */
 
 #ifndef _CAM_CAM_PERIPH_H
@@ -52,6 +52,8 @@ void periphdriver_register(void *);
                case MOD_UNLOAD: \
                        kprintf(#name " module unload - not possible for this module type\n"); \
                        return EINVAL; \
+               default: \
+                       return EOPNOTSUPP; \
                } \
                return 0; \
        } \
index 025ab89..2c71828 100644 (file)
@@ -27,7 +27,7 @@
  * SUCH DAMAGE.
  *
  * $FreeBSD: src/sys/cam/cam_xpt.c,v 1.80.2.18 2002/12/09 17:31:55 gibbs Exp $
- * $DragonFly: src/sys/bus/cam/cam_xpt.c,v 1.44 2007/11/28 21:05:00 pavalos Exp $
+ * $DragonFly: src/sys/bus/cam/cam_xpt.c,v 1.45 2007/11/28 21:29:18 pavalos Exp $
  */
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -1318,6 +1318,8 @@ cam_module_event_handler(module_t mod, int what, void *arg)
                xpt_init(NULL);
        } else if (what == MOD_UNLOAD) {
                return EBUSY;
+       } else {
+               return EOPNOTSUPP;
        }
 
        return 0;