livepatch: remove unnecessary object loaded check
authorJosh Poimboeuf <jpoimboe@redhat.com>
Tue, 14 Feb 2017 01:42:36 +0000 (19:42 -0600)
committerJiri Kosina <jkosina@suse.cz>
Wed, 8 Mar 2017 08:23:28 +0000 (09:23 +0100)
klp_patch_object()'s callers already ensure that the object is loaded,
so its call to klp_is_object_loaded() is unnecessary.

This will also make it possible to move the patching code into a
separate file.

Signed-off-by: Josh Poimboeuf <jpoimboe@redhat.com>
Acked-by: Miroslav Benes <mbenes@suse.cz>
Reviewed-by: Petr Mladek <pmladek@suse.com>
Reviewed-by: Kamalesh Babulal <kamalesh@linux.vnet.ibm.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
kernel/livepatch/core.c

index 2dbd355cee07cf36d22d7b088d80f0beea69cfee..47ed643a63623ccee3b7bd23a249d6eeddbf95cb 100644 (file)
@@ -467,9 +467,6 @@ static int klp_patch_object(struct klp_object *obj)
        if (WARN_ON(obj->patched))
                return -EINVAL;
 
-       if (WARN_ON(!klp_is_object_loaded(obj)))
-               return -EINVAL;
-
        klp_for_each_func(obj, func) {
                ret = klp_patch_func(func);
                if (ret) {