aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/livepatch/core.c
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/livepatch/core.c')
-rw-r--r--kernel/livepatch/core.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/kernel/livepatch/core.c b/kernel/livepatch/core.c
index eb5db6e837aa..28c37fa3d3f9 100644
--- a/kernel/livepatch/core.c
+++ b/kernel/livepatch/core.c
@@ -876,6 +876,9 @@ int klp_register_patch(struct klp_patch *patch)
876{ 876{
877 int ret; 877 int ret;
878 878
879 if (!patch || !patch->mod)
880 return -EINVAL;
881
879 if (!is_livepatch_module(patch->mod)) { 882 if (!is_livepatch_module(patch->mod)) {
880 pr_err("module %s is not marked as a livepatch module", 883 pr_err("module %s is not marked as a livepatch module",
881 patch->mod->name); 884 patch->mod->name);
@@ -885,9 +888,6 @@ int klp_register_patch(struct klp_patch *patch)
885 if (!klp_initialized()) 888 if (!klp_initialized())
886 return -ENODEV; 889 return -ENODEV;
887 890
888 if (!patch || !patch->mod)
889 return -EINVAL;
890
891 /* 891 /*
892 * A reference is taken on the patch module to prevent it from being 892 * A reference is taken on the patch module to prevent it from being
893 * unloaded. Right now, we don't allow patch modules to unload since 893 * unloaded. Right now, we don't allow patch modules to unload since