Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753465AbbBJSaz (ORCPT ); Tue, 10 Feb 2015 13:30:55 -0500 Received: from mail-wg0-f52.google.com ([74.125.82.52]:64721 "EHLO mail-wg0-f52.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752881AbbBJSax (ORCPT ); Tue, 10 Feb 2015 13:30:53 -0500 Message-ID: <54DA4E5A.8030100@suse.cz> Date: Tue, 10 Feb 2015 19:30:50 +0100 From: Jiri Slaby User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.4.0 MIME-Version: 1.0 To: Josh Poimboeuf , Seth Jennings , Jiri Kosina , Vojtech Pavlik CC: Masami Hiramatsu , live-patching@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [RFC PATCH 4/9] livepatch: get function sizes References: <8dd54217503f9050fbd555631a9f7affdfb29212.1423499826.git.jpoimboe@redhat.com> In-Reply-To: <8dd54217503f9050fbd555631a9f7affdfb29212.1423499826.git.jpoimboe@redhat.com> Content-Type: text/plain; charset=iso-8859-2 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1123 Lines: 37 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? regards, -- js suse labs -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/