kprobes/x86: Free 'optinsn' cache when range check fails
authorWang Nan <wangnan0@huawei.com>
Mon, 28 Jul 2014 12:20:19 +0000 (20:20 +0800)
committerIngo Molnar <mingo@kernel.org>
Wed, 27 Aug 2014 18:24:32 +0000 (20:24 +0200)
commit256aae5eac6d328067d1a986a7c5df6f19bdc8b4
treed4ae86c28902fab926ec091287514ff60143ff6c
parent68e370289c29e3beac99d59c6d840d470af9dfcf
kprobes/x86: Free 'optinsn' cache when range check fails

This patch frees the 'optinsn' slot when we get a range check error,
to prevent memory leaks.

Before this patch, cache entry in kprobe_insn_cache() won't be freed
if kprobe optimizing fails due to range check failure.

Signed-off-by: Wang Nan <wangnan0@huawei.com>
Acked-by: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
Cc: Pei Feiyue <peifeiyue@huawei.com>
Link: http://lkml.kernel.org/r/1406550019-70935-1-git-send-email-wangnan0@huawei.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
arch/x86/kernel/kprobes/opt.c