lkml.org 
[lkml]   [2022]   [Aug]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH -next 3/3] fail_function: fix wrong use of fei_attr_remove()
Date
If register_kprobe() fails, the new attr is not added to the list yet,
so it should call fei_attr_free() intstead.

Fixes: 4b1a29a7f542 ("error-injection: Support fault injection framework")
Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
---
kernel/fail_function.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

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);
--
2.25.1
\
 
 \ /
  Last update: 2022-08-26 09:27    [W:0.083 / U:0.464 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site