summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYang Yingliang <yangyingliang@huawei.com>2022-08-26 15:33:37 +0800
committerAndrew Morton <akpm@linux-foundation.org>2022-09-11 21:55:11 -0700
commitd2e85432a2e0a6f31bd9489800f443228f020ed6 (patch)
tree06a9d500826ffe0e67fdd5fe0ce85ad372d6904c
parentcef9f5f866ad45a2dd64fed6e6b657043c2c6f17 (diff)
fail_function: fix wrong use of fei_attr_remove()
If register_kprobe() fails, the new attr is not added to the list yet, so it should call fei_attr_free() intstead. Link: https://lkml.kernel.org/r/20220826073337.2085798-3-yangyingliang@huawei.com Fixes: 4b1a29a7f542 ("error-injection: Support fault injection framework") Signed-off-by: Yang Yingliang <yangyingliang@huawei.com> Reviewed-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
-rw-r--r--kernel/fail_function.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/kernel/fail_function.c b/kernel/fail_function.c
index 893e8f9a9118..a7ccd2930c5f 100644
--- a/kernel/fail_function.c
+++ b/kernel/fail_function.c
@@ -295,7 +295,7 @@ static ssize_t fei_write(struct file *file, const char __user *buffer,
ret = register_kprobe(&attr->kp);
if (ret) {
- fei_attr_remove(attr);
+ fei_attr_free(attr);
goto out;
}
fei_debugfs_add_attr(attr);