diff options
author | Josh Poimboeuf <jpoimboe@redhat.com> | 2017-02-13 20:42:36 -0500 |
---|---|---|
committer | Jiri Kosina <jkosina@suse.cz> | 2017-03-08 03:23:28 -0500 |
commit | aa82dc3e00da63751bb9dfab26983037b79fc39d (patch) | |
tree | 81e8b465b61c2fe4f872f5a200803a72507d5e20 /kernel/livepatch/core.c | |
parent | 0dade9f374f1c15f9b43ab01ab75a3b459bba5f6 (diff) |
livepatch: remove unnecessary object loaded check
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>
Diffstat (limited to 'kernel/livepatch/core.c')
-rw-r--r-- | kernel/livepatch/core.c | 3 |
1 files changed, 0 insertions, 3 deletions
diff --git a/kernel/livepatch/core.c b/kernel/livepatch/core.c index 2dbd355cee07..47ed643a6362 100644 --- a/kernel/livepatch/core.c +++ b/kernel/livepatch/core.c | |||
@@ -467,9 +467,6 @@ static int klp_patch_object(struct klp_object *obj) | |||
467 | if (WARN_ON(obj->patched)) | 467 | if (WARN_ON(obj->patched)) |
468 | return -EINVAL; | 468 | return -EINVAL; |
469 | 469 | ||
470 | if (WARN_ON(!klp_is_object_loaded(obj))) | ||
471 | return -EINVAL; | ||
472 | |||
473 | klp_for_each_func(obj, func) { | 470 | klp_for_each_func(obj, func) { |
474 | ret = klp_patch_func(func); | 471 | ret = klp_patch_func(func); |
475 | if (ret) { | 472 | if (ret) { |