Skip to content

Commit d2e8543

Browse files
Yang Yingliangakpm00
authored andcommitted
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: 4b1a29a ("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>
1 parent cef9f5f commit d2e8543

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

kernel/fail_function.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -295,7 +295,7 @@ static ssize_t fei_write(struct file *file, const char __user *buffer,
295295

296296
ret = register_kprobe(&attr->kp);
297297
if (ret) {
298-
fei_attr_remove(attr);
298+
fei_attr_free(attr);
299299
goto out;
300300
}
301301
fei_debugfs_add_attr(attr);

0 commit comments

Comments
 (0)