Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754190AbbBJTtM (ORCPT ); Tue, 10 Feb 2015 14:49:12 -0500 Received: from mx1.redhat.com ([209.132.183.28]:41453 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753362AbbBJTtK (ORCPT ); Tue, 10 Feb 2015 14:49:10 -0500 Date: Tue, 10 Feb 2015 12:53:49 -0600 From: Josh Poimboeuf To: Jiri Slaby Cc: Seth Jennings , Jiri Kosina , Vojtech Pavlik , Masami Hiramatsu , live-patching@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [RFC PATCH 4/9] livepatch: get function sizes Message-ID: <20150210185349.GJ21643@treble.redhat.com> References: <8dd54217503f9050fbd555631a9f7affdfb29212.1423499826.git.jpoimboe@redhat.com> <54DA4E5A.8030100@suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <54DA4E5A.8030100@suse.cz> User-Agent: Mutt/1.5.23.1-rc1 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1225 Lines: 38 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 -- 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/