[core] hook: fixed failure to initialize the kprobe struct completely

This commit is contained in:
Geoffrey McRae 2020-11-11 11:24:42 +11:00
parent 69e33e3cb8
commit 4dc9a80657
1 changed files with 2 additions and 3 deletions

View File

@ -34,9 +34,8 @@ Place, Suite 330, Boston, MA 02111-1307 USA
*/
static int resolve_hook_address(struct ftrace_hook *hook)
{
struct kprobe kp;
struct kprobe kp = { .symbol_name = hook->name };
kp.symbol_name = hook->name;
if (register_kprobe(&kp))
{
pr_warn("unresolved symbol %s\n", hook->name);
@ -122,4 +121,4 @@ void fh_remove_hooks(struct ftrace_hook *hooks)
for (hook = hooks; hook->name; ++hook)
fh_remove_hook(hook);
}
}