提交 89a9a1c1 编写于 作者: P Petr Mladek 提交者: Jiri Kosina

livepatch: __klp_disable_patch() should never be called for disabled patches

__klp_disable_patch() should never be called when the patch is not
enabled. Let's add the same warning that we have in __klp_enable_patch().

This allows to remove the check when calling klp_pre_unpatch_callback().
It was strange anyway because it repeatedly checked per-patch flag
for each patched object.
Signed-off-by: NPetr Mladek <pmladek@suse.com>
Acked-by: NJoe Lawrence <joe.lawrence@redhat.com>
Signed-off-by: NJiri Kosina <jkosina@suse.cz>
上级 5aaf1ab5
......@@ -282,6 +282,9 @@ static int __klp_disable_patch(struct klp_patch *patch)
{
struct klp_object *obj;
if (WARN_ON(!patch->enabled))
return -EINVAL;
if (klp_transition_patch)
return -EBUSY;
......@@ -293,7 +296,7 @@ static int __klp_disable_patch(struct klp_patch *patch)
klp_init_transition(patch, KLP_UNPATCHED);
klp_for_each_object(patch, obj)
if (patch->enabled && obj->patched)
if (obj->patched)
klp_pre_unpatch_callback(obj);
/*
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册