We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ba883b4 commit 38115f2Copy full SHA for 38115f2
arch/x86/kernel/kprobes/core.c
@@ -457,6 +457,8 @@ static int arch_copy_kprobe(struct kprobe *p)
457
458
int arch_prepare_kprobe(struct kprobe *p)
459
{
460
+ int ret;
461
+
462
if (alternatives_text_reserved(p->addr, p->addr))
463
return -EINVAL;
464
@@ -467,7 +469,13 @@ int arch_prepare_kprobe(struct kprobe *p)
467
469
if (!p->ainsn.insn)
468
470
return -ENOMEM;
471
- return arch_copy_kprobe(p);
472
+ ret = arch_copy_kprobe(p);
473
+ if (ret) {
474
+ free_insn_slot(p->ainsn.insn, 0);
475
+ p->ainsn.insn = NULL;
476
+ }
477
478
+ return ret;
479
}
480
481
void arch_arm_kprobe(struct kprobe *p)
0 commit comments