mirror of https://github.com/dynup/kpatch
kmod/core: kpatch_unregister return error if !kpmod->enabled
It's probably cleaner to just return -EINVAL if the kpmod isn't enabled, instead of warning and continuing, which would be dangerous. I think the reason I had it WARN before is because this condition shouldn't be possible given the source for the patch module. But the core module can't necessarily assume that it's our trustworthy patch module code on the other side.
This commit is contained in:
parent
4bde6c3bbf
commit
6ee8803978
|
@ -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);
|
||||
|
||||
|
|
Loading…
Reference in New Issue