lkml.org 
[lkml]   [2015]   [Feb]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [RFC PATCH 4/9] livepatch: get function sizes
On Tue, Feb 10, 2015 at 07:30:50PM +0100, Jiri Slaby wrote:
> On 02/09/2015, 06:31 PM, Josh Poimboeuf wrote:
> > --- a/kernel/livepatch/core.c
> > +++ b/kernel/livepatch/core.c
> > @@ -197,8 +197,25 @@ static int klp_find_verify_func_addr(struct klp_object *obj,
> > else
> > ret = klp_verify_vmlinux_symbol(func->old_name,
> > func->old_addr);
> > + if (ret)
> > + return ret;
> >
> > - return ret;
> > + ret = kallsyms_lookup_size_offset(func->old_addr, &func->old_size,
> > + NULL);
> > + if (!ret) {
> > + pr_err("kallsyms lookup failed for '%s'\n", func->old_name);
> > + return -EINVAL;
> > + }
> > +
> > + ret = kallsyms_lookup_size_offset((unsigned long)func->new_func,
> > + &func->new_size, NULL);
> > + if (!ret) {
> > + pr_err("kallsyms lookup failed for '%s' replacement\n",
> > + func->old_name);
> > + return -EINVAL;
>
> EINVAL does not seem to be an appropriate return value for "not found".
> Maybe ENOENT?

Ok.

--
Josh


\
 
 \ /
  Last update: 2015-02-10 21:01    [W:0.103 / U:8.152 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site