diff --git a/kmod/core/core.c b/kmod/core/core.c index 9c39127..995ac62 100644 --- a/kmod/core/core.c +++ b/kmod/core/core.c @@ -543,7 +543,8 @@ int kpatch_unregister(struct kpatch_module *kpmod) int num_funcs = kpmod->num_funcs; int i, ret; - WARN_ON(!kpmod->enabled); + if (!kpmod->enabled) + return -EINVAL; down(&kpatch_mutex);