diff options
Diffstat (limited to 'sys')
59 files changed, 101 insertions, 20 deletions
diff --git a/sys/alpha/linux/linux_sysvec.c b/sys/alpha/linux/linux_sysvec.c index add35a3..e3b91ee 100644 --- a/sys/alpha/linux/linux_sysvec.c +++ b/sys/alpha/linux/linux_sysvec.c @@ -274,6 +274,7 @@ linux_elf_modevent(module_t mod, int type, void *data) printf("Could not deinstall ELF interpreter entry\n"); break; default: + return (EOPNOTSUPP); break; } return error; diff --git a/sys/cam/cam_periph.h b/sys/cam/cam_periph.h index 9f27180..88a709d 100644 --- a/sys/cam/cam_periph.h +++ b/sys/cam/cam_periph.h @@ -53,6 +53,8 @@ void periphdriver_register(void *); case MOD_UNLOAD: \ printf(#name " module unload - not possible for this module type\n"); \ return EINVAL; \ + default: \ + return EOPNOTSUPP; \ } \ return 0; \ } \ diff --git a/sys/cam/cam_xpt.c b/sys/cam/cam_xpt.c index 592809f..19116a1 100644 --- a/sys/cam/cam_xpt.c +++ b/sys/cam/cam_xpt.c @@ -1348,6 +1348,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; diff --git a/sys/coda/coda_fbsd.c b/sys/coda/coda_fbsd.c index 89d4de0..d3feff0 100644 --- a/sys/coda/coda_fbsd.c +++ b/sys/coda/coda_fbsd.c @@ -90,9 +90,9 @@ codadev_modevent(module_t mod, int type, void *data) case MOD_LOAD: break; case MOD_UNLOAD: - break; + return (EBUSY); default: - break; + return (EOPNOTSUPP); } return 0; } diff --git a/sys/compat/svr4/svr4_sysvec.c b/sys/compat/svr4/svr4_sysvec.c index e312d6a..64639f2e 100644 --- a/sys/compat/svr4/svr4_sysvec.c +++ b/sys/compat/svr4/svr4_sysvec.c @@ -411,6 +411,7 @@ svr4_elf_modevent(module_t mod, int type, void *data) printf("svr4 ELF exec handler removed\n"); break; default: + return (EOPNOTSUPP); break; } return error; diff --git a/sys/dev/aic7xxx/aic79xx_osm.c b/sys/dev/aic7xxx/aic79xx_osm.c index bbe07f6..921bae9 100644 --- a/sys/dev/aic7xxx/aic79xx_osm.c +++ b/sys/dev/aic7xxx/aic79xx_osm.c @@ -1540,6 +1540,7 @@ static int ahd_modevent(module_t mod, int type, void *data) { /* XXX Deal with busy status on unload. */ + /* XXX Deal with unknown events */ return 0; } diff --git a/sys/dev/aic7xxx/aic7xxx_osm.c b/sys/dev/aic7xxx/aic7xxx_osm.c index 3034f9b..1c11f76 100644 --- a/sys/dev/aic7xxx/aic7xxx_osm.c +++ b/sys/dev/aic7xxx/aic7xxx_osm.c @@ -1663,6 +1663,7 @@ static int ahc_modevent(module_t mod, int type, void *data) { /* XXX Deal with busy status on unload. */ + /* XXX Deal with unknown events */ return 0; } diff --git a/sys/dev/bktr/bktr_mem.c b/sys/dev/bktr/bktr_mem.c index 278e6b8..3adacce 100644 --- a/sys/dev/bktr/bktr_mem.c +++ b/sys/dev/bktr/bktr_mem.c @@ -88,6 +88,7 @@ bktr_mem_modevent(module_t mod, int type, void *unused){ printf("bktr_mem: memory holder cannot be unloaded\n"); return EBUSY; default: + return EOPNOTSUPP; break; } return (0); diff --git a/sys/dev/dcons/dcons.c b/sys/dev/dcons/dcons.c index 25494a0..2677444 100644 --- a/sys/dev/dcons/dcons.c +++ b/sys/dev/dcons/dcons.c @@ -651,6 +651,9 @@ dcons_modevent(module_t mode, int type, void *data) break; case MOD_SHUTDOWN: break; + default: + err = EOPNOTSUPP; + break; } return(err); } diff --git a/sys/dev/fb/fb.c b/sys/dev/fb/fb.c index 38b9670..0878feb 100644 --- a/sys/dev/fb/fb.c +++ b/sys/dev/fb/fb.c @@ -386,6 +386,8 @@ fb_modevent(module_t mod, int type, void *data) case MOD_UNLOAD: printf("fb module unload - not possible for this module type\n"); return EINVAL; + default: + return EOPNOTSUPP; } return 0; } diff --git a/sys/dev/fb/splashreg.h b/sys/dev/fb/splashreg.h index 05e5687..36ba9a7 100644 --- a/sys/dev/fb/splashreg.h +++ b/sys/dev/fb/splashreg.h @@ -55,6 +55,7 @@ typedef struct image_decoder scrn_saver_t; case MOD_UNLOAD: \ return splash_unregister(&sw); \ default: \ + return EOPNOTSUPP; \ break; \ } \ return 0; \ @@ -76,6 +77,7 @@ typedef struct image_decoder scrn_saver_t; case MOD_UNLOAD: \ return splash_unregister(&sw); \ default: \ + return EOPNOTSUPP; \ break; \ } \ return 0; \ diff --git a/sys/dev/firewire/firewire.c b/sys/dev/firewire/firewire.c index 6342a18..9bd5dd6 100644 --- a/sys/dev/firewire/firewire.c +++ b/sys/dev/firewire/firewire.c @@ -2273,6 +2273,8 @@ fw_modevent(module_t mode, int type, void *data) break; case MOD_SHUTDOWN: break; + default: + return (EOPNOTSUPP); } return (err); } diff --git a/sys/dev/harp/if_harp.c b/sys/dev/harp/if_harp.c index 87711b9..435b64e 100644 --- a/sys/dev/harp/if_harp.c +++ b/sys/dev/harp/if_harp.c @@ -646,6 +646,8 @@ harp_modevent(module_t mod, int event, void *data) uma_zdestroy(harp_vcc_zone); break; + default: + return (EOPNOTSUPP); } return (0); } diff --git a/sys/dev/hfa/hfa_freebsd.c b/sys/dev/hfa/hfa_freebsd.c index 48a15ac..34db172 100644 --- a/sys/dev/hfa/hfa_freebsd.c +++ b/sys/dev/hfa/hfa_freebsd.c @@ -451,6 +451,7 @@ hfa_modevent (module_t mod, int type, void *data) break; default: + return (EOPNOTSUPP); break; } diff --git a/sys/dev/ispfw/ispfw.c b/sys/dev/ispfw/ispfw.c index f0b0a4d..633fdf7 100644 --- a/sys/dev/ispfw/ispfw.c +++ b/sys/dev/ispfw/ispfw.c @@ -164,6 +164,7 @@ isp_module_handler(module_t mod, int what, void *arg) } break; default: + return (EOPNOTSUPP); break; } return (0); diff --git a/sys/dev/md/md.c b/sys/dev/md/md.c index 295d8d2..e6dc8b5 100644 --- a/sys/dev/md/md.c +++ b/sys/dev/md/md.c @@ -1237,6 +1237,7 @@ md_modevent(module_t mod, int type, void *data) status_dev = 0; break; default: + return (EOPNOTSUPP); break; } return (0); diff --git a/sys/dev/null/null.c b/sys/dev/null/null.c index 14841d3..4f7bd9c 100644 --- a/sys/dev/null/null.c +++ b/sys/dev/null/null.c @@ -135,6 +135,8 @@ null_modevent(module_t mod __unused, int type, void *data __unused) case MOD_SHUTDOWN: break; + default: + return (EOPNOTSUPP); } return (0); diff --git a/sys/dev/ofw/openpromio.c b/sys/dev/ofw/openpromio.c index 3182bff..b2e3454 100644 --- a/sys/dev/ofw/openpromio.c +++ b/sys/dev/ofw/openpromio.c @@ -215,7 +215,7 @@ openprom_modevent(module_t mode, int type, void *data) destroy_dev(openprom_dev); return (0); default: - return (0); + return (EOPNOTSUPP); } } diff --git a/sys/dev/random/randomdev.c b/sys/dev/random/randomdev.c index 7c5434e..28cddd9 100644 --- a/sys/dev/random/randomdev.c +++ b/sys/dev/random/randomdev.c @@ -220,6 +220,10 @@ random_modevent(module_t mod __unused, int type, void *data __unused) case MOD_SHUTDOWN: break; + default: + error = EOPNOTSUPP; + break; + } return (error); } diff --git a/sys/dev/snp/snp.c b/sys/dev/snp/snp.c index 3d4b2d4..a352707 100644 --- a/sys/dev/snp/snp.c +++ b/sys/dev/snp/snp.c @@ -650,6 +650,7 @@ snp_modevent(mod, type, data) ldisc_deregister(snooplinedisc); break; default: + return (EOPNOTSUPP); break; } return (0); diff --git a/sys/dev/sound/driver.c b/sys/dev/sound/driver.c index 57427d6..f995266 100644 --- a/sys/dev/sound/driver.c +++ b/sys/dev/sound/driver.c @@ -38,6 +38,7 @@ snd_modevent(module_t mod, int type, void *data) case MOD_UNLOAD: break; default: + return (EOPNOTSUPP); break; } return 0; diff --git a/sys/dev/streams/streams.c b/sys/dev/streams/streams.c index 8ef790d..1df0952 100644 --- a/sys/dev/streams/streams.c +++ b/sys/dev/streams/streams.c @@ -165,6 +165,7 @@ streams_modevent(module_t mod, int type, void *unused) return 0; default: + return EOPNOTSUPP; break; } return 0; diff --git a/sys/dev/syscons/syscons.h b/sys/dev/syscons/syscons.h index 1651ad8..29909f9 100644 --- a/sys/dev/syscons/syscons.h +++ b/sys/dev/syscons/syscons.h @@ -391,6 +391,7 @@ typedef struct sc_term_sw { return EBUSY; \ return sc_term_remove(&sw); \ default: \ + return EOPNOTSUPP; \ break; \ } \ return 0; \ @@ -462,6 +463,7 @@ typedef struct sc_renderer { } \ break; \ default: \ + return EOPNOTSUPP; \ break; \ } \ return error; \ diff --git a/sys/dev/utopia/utopia.c b/sys/dev/utopia/utopia.c index c648349..263f4b9 100644 --- a/sys/dev/utopia/utopia.c +++ b/sys/dev/utopia/utopia.c @@ -1550,6 +1550,8 @@ utopia_mod_init(module_t mod, int what, void *arg) UTP_WUNLOCK_LIST(); mtx_destroy(&utopia_list_mtx); break; + default: + return (EOPNOTSUPP); } return (0); } diff --git a/sys/dev/vinum/vinum.c b/sys/dev/vinum/vinum.c index 062176b..5fb990d 100644 --- a/sys/dev/vinum/vinum.c +++ b/sys/dev/vinum/vinum.c @@ -318,6 +318,7 @@ vinum_modevent(module_t mod, modeventtype_t type, void *unused) EVENTHANDLER_DEREGISTER(dev_clone, dev_clone_tag); return 0; default: + return EOPNOTSUPP; break; } return 0; diff --git a/sys/fs/coda/coda_fbsd.c b/sys/fs/coda/coda_fbsd.c index 89d4de0..d3feff0 100644 --- a/sys/fs/coda/coda_fbsd.c +++ b/sys/fs/coda/coda_fbsd.c @@ -90,9 +90,9 @@ codadev_modevent(module_t mod, int type, void *data) case MOD_LOAD: break; case MOD_UNLOAD: - break; + return (EBUSY); default: - break; + return (EOPNOTSUPP); } return 0; } diff --git a/sys/fs/pseudofs/pseudofs.c b/sys/fs/pseudofs/pseudofs.c index 872bd8d..22d6286 100644 --- a/sys/fs/pseudofs/pseudofs.c +++ b/sys/fs/pseudofs/pseudofs.c @@ -394,7 +394,7 @@ pfs_modevent(module_t mod, int evt, void *arg) pfs_fileno_unload(); break; default: - printf("pseudofs: unexpected event type %d\n", evt); + return EOPNOTSUPP; break; } return 0; diff --git a/sys/fs/unionfs/union_subr.c b/sys/fs/unionfs/union_subr.c index 8d05f8c..99b86ea 100644 --- a/sys/fs/unionfs/union_subr.c +++ b/sys/fs/unionfs/union_subr.c @@ -1363,6 +1363,7 @@ union_modevent(module_t mod, int type, void *data) union_dircheckp = NULL; break; default: + return EOPNOTSUPP; break; } return 0; diff --git a/sys/geom/gate/g_gate.c b/sys/geom/gate/g_gate.c index 4668235..f70068f 100644 --- a/sys/geom/gate/g_gate.c +++ b/sys/geom/gate/g_gate.c @@ -635,6 +635,7 @@ g_gate_modevent(module_t mod, int type, void *data) destroy_dev(status_dev); break; default: + return (EOPNOTSUPP); break; } diff --git a/sys/i386/ibcs2/ibcs2_sysvec.c b/sys/i386/ibcs2/ibcs2_sysvec.c index af5015d..fc63973 100644 --- a/sys/i386/ibcs2/ibcs2_sysvec.c +++ b/sys/i386/ibcs2/ibcs2_sysvec.c @@ -116,7 +116,7 @@ ibcs2_modevent(module_t mod, int type, void *unused) } sx_sunlock(&allproc_lock); default: - /* do not care */ + return (EOPNOTSUPP); break; } return (rval); diff --git a/sys/i386/isa/vesa.c b/sys/i386/isa/vesa.c index 65739aa..d51f68f 100644 --- a/sys/i386/isa/vesa.c +++ b/sys/i386/isa/vesa.c @@ -1652,7 +1652,7 @@ vesa_mod_event(module_t mod, int type, void *data) case MOD_UNLOAD: return vesa_unload(); default: - break; + return EOPNOTSUPP; } return 0; } diff --git a/sys/i386/linux/linux_sysvec.c b/sys/i386/linux/linux_sysvec.c index 5972a57..bb7e338 100644 --- a/sys/i386/linux/linux_sysvec.c +++ b/sys/i386/linux/linux_sysvec.c @@ -960,7 +960,7 @@ linux_elf_modevent(module_t mod, int type, void *data) printf("Could not deinstall ELF interpreter entry\n"); break; default: - break; + return EOPNOTSUPP; } return error; } diff --git a/sys/i4b/include/i4b_global.h b/sys/i4b/include/i4b_global.h index fe1bb71..bb77527 100644 --- a/sys/i4b/include/i4b_global.h +++ b/sys/i4b/include/i4b_global.h @@ -57,6 +57,8 @@ case MOD_UNLOAD: \ printf(#name " module unload - not possible for this module type\n"); \ return EINVAL; \ + default: \ + return EOPNOTSUPP; \ } \ return 0; \ } \ diff --git a/sys/kern/kern_mac.c b/sys/kern/kern_mac.c index 94dfc26..db6fc59 100644 --- a/sys/kern/kern_mac.c +++ b/sys/kern/kern_mac.c @@ -359,6 +359,7 @@ mac_policy_modevent(module_t mod, int type, void *data) error = 0; break; default: + error = EOPNOTSUPP; break; } diff --git a/sys/kern/kern_module.c b/sys/kern/kern_module.c index a8c704e..9dfe3ba 100644 --- a/sys/kern/kern_module.c +++ b/sys/kern/kern_module.c @@ -228,7 +228,7 @@ module_unload(module_t mod, int flags) int error; error = MOD_EVENT(mod, MOD_QUIESCE); - if (error == EOPNOTSUPP) + if (error == EOPNOTSUPP || error == EINVAL) error = 0; if (flags == LINKER_UNLOAD_NORMAL && error != 0) return (error); diff --git a/sys/kern/kern_syscalls.c b/sys/kern/kern_syscalls.c index 3f8a38b..a437fb3 100644 --- a/sys/kern/kern_syscalls.c +++ b/sys/kern/kern_syscalls.c @@ -115,6 +115,9 @@ syscall_module_handler(struct module *mod, int what, void *arg) } error = syscall_deregister(data->offset, &data->old_sysent); return error; + default : + return EOPNOTSUPP; + } if (data->chainevh) diff --git a/sys/kern/subr_bus.c b/sys/kern/subr_bus.c index 8c8b799..ae59230 100644 --- a/sys/kern/subr_bus.c +++ b/sys/kern/subr_bus.c @@ -2535,6 +2535,8 @@ root_bus_module_handler(module_t mod, int what, void* arg) case MOD_SHUTDOWN: device_shutdown(root_bus); return (0); + default: + return (EOPNOTSUPP); } return (0); @@ -2612,6 +2614,9 @@ driver_module_handler(module_t mod, int what, void *arg) if (!error && dmd->dmd_chainevh) error = dmd->dmd_chainevh(mod,what,dmd->dmd_chainarg); break; + default: + error = EOPNOTSUPP; + break; } return (error); diff --git a/sys/kern/vfs_init.c b/sys/kern/vfs_init.c index 871404c..9597519 100644 --- a/sys/kern/vfs_init.c +++ b/sys/kern/vfs_init.c @@ -528,7 +528,8 @@ vfs_modevent(module_t mod, int type, void *data) if (vfc) error = vfs_unregister(vfc); break; - default: /* including MOD_SHUTDOWN */ + default: + error = EOPNOTSUPP; break; } return (error); diff --git a/sys/net/if_disc.c b/sys/net/if_disc.c index 6132da9..1b71630 100644 --- a/sys/net/if_disc.c +++ b/sys/net/if_disc.c @@ -155,6 +155,8 @@ disc_modevent(module_t mod, int type, void *data) mtx_unlock(&disc_mtx); mtx_destroy(&disc_mtx); break; + default: + return (EOPNOTSUPP); } return (0); } diff --git a/sys/net/if_ef.c b/sys/net/if_ef.c index 23741d1..616be9f 100644 --- a/sys/net/if_ef.c +++ b/sys/net/if_ef.c @@ -584,7 +584,7 @@ if_ef_modevent(module_t mod, int type, void *data) case MOD_UNLOAD: return ef_unload(); default: - break; + return EOPNOTSUPP; } return 0; } diff --git a/sys/net/if_faith.c b/sys/net/if_faith.c index c8da1cd..91b727c 100644 --- a/sys/net/if_faith.c +++ b/sys/net/if_faith.c @@ -145,6 +145,8 @@ faithmodevent(mod, type, data) mtx_unlock(&faith_mtx); mtx_destroy(&faith_mtx); break; + default: + return EOPNOTSUPP; } return 0; } diff --git a/sys/net/if_gif.c b/sys/net/if_gif.c index 84ba528..6d2221c 100644 --- a/sys/net/if_gif.c +++ b/sys/net/if_gif.c @@ -255,6 +255,8 @@ gifmodevent(mod, type, data) ip6_gif_hlim = 0; #endif break; + default: + return EOPNOTSUPP; } return 0; } diff --git a/sys/net/if_gre.c b/sys/net/if_gre.c index a5dcc7d..c0feec0 100644 --- a/sys/net/if_gre.c +++ b/sys/net/if_gre.c @@ -767,6 +767,8 @@ gremodevent(module_t mod, int type, void *data) mtx_unlock(&gre_mtx); mtx_destroy(&gre_mtx); break; + default: + return EOPNOTSUPP; } return 0; } diff --git a/sys/net/if_loop.c b/sys/net/if_loop.c index 97af1d3..8c4c5da 100644 --- a/sys/net/if_loop.c +++ b/sys/net/if_loop.c @@ -172,6 +172,8 @@ loop_modevent(module_t mod, int type, void *data) case MOD_UNLOAD: printf("loop module unload - not possible for this module type\n"); return EINVAL; + default: + return EOPNOTSUPP; } return 0; } diff --git a/sys/net/if_ppp.c b/sys/net/if_ppp.c index 2e808da..8f06594 100644 --- a/sys/net/if_ppp.c +++ b/sys/net/if_ppp.c @@ -294,6 +294,8 @@ ppp_modevent(module_t mod, int type, void *data) } PPP_LIST_LOCK_DESTROY(); break; + default: + return EOPNOTSUPP; } return 0; } diff --git a/sys/net/if_sl.c b/sys/net/if_sl.c index 220e9ec..6d2b996 100644 --- a/sys/net/if_sl.c +++ b/sys/net/if_sl.c @@ -210,6 +210,8 @@ sl_modevent(module_t mod, int type, void *data) ldisc_deregister(SLIPDISC); printf("if_sl module unload - not possible for this module type\n"); return EINVAL; + default: + return EOPNOTSUPP; } return 0; } diff --git a/sys/net/if_spppsubr.c b/sys/net/if_spppsubr.c index bfc01f0..4c9f304 100644 --- a/sys/net/if_spppsubr.c +++ b/sys/net/if_spppsubr.c @@ -484,9 +484,8 @@ sppp_modevent(module_t mod, int type, void *unused) break; case MOD_UNLOAD: return EACCES; - break; default: - break; + return EOPNOTSUPP; } return 0; } diff --git a/sys/net/if_stf.c b/sys/net/if_stf.c index 2f9eb02..eff2c7e 100644 --- a/sys/net/if_stf.c +++ b/sys/net/if_stf.c @@ -301,6 +301,8 @@ stfmodevent(mod, type, data) mtx_unlock(&stf_mtx); mtx_destroy(&stf_mtx); break; + default: + return (EOPNOTSUPP); } return (0); diff --git a/sys/net/if_tun.c b/sys/net/if_tun.c index 23cb20b..065f6c9 100644 --- a/sys/net/if_tun.c +++ b/sys/net/if_tun.c @@ -204,6 +204,8 @@ tunmodevent(module_t mod, int type, void *data) clone_cleanup(&tunclones); mtx_destroy(&tunmtx); break; + default: + return EOPNOTSUPP; } return 0; } diff --git a/sys/net/if_vlan.c b/sys/net/if_vlan.c index da9b280..4f6e0bd 100644 --- a/sys/net/if_vlan.c +++ b/sys/net/if_vlan.c @@ -248,6 +248,8 @@ vlan_modevent(module_t mod, int type, void *data) &LIST_FIRST(&ifv_list)->ifv_if); VLAN_LOCK_DESTROY(); break; + default: + return (EOPNOTSUPP); } return (0); } diff --git a/sys/netgraph/ng_base.c b/sys/netgraph/ng_base.c index c18a577..cd0e336 100644 --- a/sys/netgraph/ng_base.c +++ b/sys/netgraph/ng_base.c @@ -2954,7 +2954,7 @@ ng_mod_event(module_t mod, int event, void *data) if (type->mod_event != NULL) error = (*type->mod_event)(mod, event, data); else - error = 0; /* XXX ? */ + error = EOPNOTSUPP; /* XXX ? */ break; } return (error); diff --git a/sys/netinet/ip_dummynet.c b/sys/netinet/ip_dummynet.c index 62f56a6..40e17d4 100644 --- a/sys/netinet/ip_dummynet.c +++ b/sys/netinet/ip_dummynet.c @@ -2080,6 +2080,7 @@ dummynet_modevent(module_t mod, int type, void *data) #endif break ; default: + return EOPNOTSUPP; break ; } return 0 ; diff --git a/sys/netinet/ip_fw2.c b/sys/netinet/ip_fw2.c index f640e24..19f54ca 100644 --- a/sys/netinet/ip_fw2.c +++ b/sys/netinet/ip_fw2.c @@ -3441,6 +3441,7 @@ ipfw_modevent(module_t mod, int type, void *unused) err = 0; break; default: + return EOPNOTSUPP; break; } return err; diff --git a/sys/netinet/ip_mroute.c b/sys/netinet/ip_mroute.c index 9230d02..5aab2ff 100644 --- a/sys/netinet/ip_mroute.c +++ b/sys/netinet/ip_mroute.c @@ -3421,6 +3421,8 @@ ip_mroute_modevent(module_t mod, int type, void *unused) MFC_LOCK_DESTROY(); mtx_destroy(&mrouter_mtx); break; + default: + return EOPNOTSUPP; } return 0; } diff --git a/sys/netinet6/ip6_fw.c b/sys/netinet6/ip6_fw.c index 2398ed5..c7c812d 100644 --- a/sys/netinet6/ip6_fw.c +++ b/sys/netinet6/ip6_fw.c @@ -1293,6 +1293,7 @@ ip6fw_modevent(module_t mod, int type, void *unused) printf("IPv6 firewall unloaded\n"); return 0; default: + return EOPNOTSUPP; break; } return 0; diff --git a/sys/nfsserver/nfs_srvsubs.c b/sys/nfsserver/nfs_srvsubs.c index 326c3c5..77ba6e6 100644 --- a/sys/nfsserver/nfs_srvsubs.c +++ b/sys/nfsserver/nfs_srvsubs.c @@ -521,9 +521,9 @@ static const short *nfsrv_v3errmap[] = { static int nfsrv_modevent(module_t mod, int type, void *data) { + int error = 0; NET_LOCK_GIANT(); - switch (type) { case MOD_LOAD: mtx_init(&nfsd_mtx, "nfsd_mtx", NULL, MTX_DEF); @@ -556,10 +556,10 @@ nfsrv_modevent(module_t mod, int type, void *data) sysent[SYS_nfssvc].sy_call = (sy_call_t *)nfssvc; break; - case MOD_UNLOAD: + case MOD_UNLOAD: if (nfsrv_numnfsd != 0) { - NET_UNLOCK_GIANT(); - return EBUSY; + error = EBUSY; + break; } callout_stop(&nfsrv_callout); @@ -567,9 +567,12 @@ nfsrv_modevent(module_t mod, int type, void *data) sysent[SYS_nfssvc].sy_call = nfs_prev_nfssvc_sy_call; mtx_destroy(&nfsd_mtx); break; + default: + error = EOPNOTSUPP; + break; } NET_UNLOCK_GIANT(); - return 0; + return error; } static moduledata_t nfsserver_mod = { "nfsserver", diff --git a/sys/security/mac/mac_framework.c b/sys/security/mac/mac_framework.c index 94dfc26..db6fc59 100644 --- a/sys/security/mac/mac_framework.c +++ b/sys/security/mac/mac_framework.c @@ -359,6 +359,7 @@ mac_policy_modevent(module_t mod, int type, void *data) error = 0; break; default: + error = EOPNOTSUPP; break; } diff --git a/sys/security/mac/mac_syscalls.c b/sys/security/mac/mac_syscalls.c index 94dfc26..db6fc59 100644 --- a/sys/security/mac/mac_syscalls.c +++ b/sys/security/mac/mac_syscalls.c @@ -359,6 +359,7 @@ mac_policy_modevent(module_t mod, int type, void *data) error = 0; break; default: + error = EOPNOTSUPP; break; } diff --git a/sys/sys/exec.h b/sys/sys/exec.h index cd14c24..07becaf 100644 --- a/sys/sys/exec.h +++ b/sys/sys/exec.h @@ -105,6 +105,7 @@ int exec_unregister(const struct execsw *); printf(__XSTRING(name) " unregister failed\n");\ break; \ default: \ + error = EOPNOTSUPP; \ break; \ } \ return error; \ |