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.
Showing the changes to kernel/livepatch (1 of 1 file). Show all
Unified · Split
| @@ -467,9 +467,6 @@ static int klp_patch_object(struct klp_object *obj) · 466 unmodified lines | ||
| 467 | 467 | if (WARN_ON(obj->patched)) |
| 468 | 468 | return -EINVAL; |
| 469 | 469 | |
| 470 | − if (WARN_ON(!klp_is_object_loaded(obj))) | |
| 471 | − return -EINVAL; | |
| 472 | − | |
| 473 | 470 | klp_for_each_func(obj, func) { |
| 474 | 471 | ret = klp_patch_func(func); |
| 475 | 472 | if (ret) { |