From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1422941AbbEOBcm (ORCPT ); Thu, 14 May 2015 21:32:42 -0400 Received: from mx1.redhat.com ([209.132.183.28]:38803 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1422687AbbEOBcj (ORCPT ); Thu, 14 May 2015 21:32:39 -0400 Date: Fri, 15 May 2015 09:35:49 +0800 From: Minfei Huang To: Josh Poimboeuf Cc: Minfei Huang , sjenning@redhat.com, jkosina@suse.cz, vojtech@suse.cz, live-patching@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v4] livepatch: Prevent to apply the patch once coming module notifier fails Message-ID: <20150515013549.GA22709@dhcp-128-1.nay.redhat.com> References: <1431568267-23241-1-git-send-email-mnfhuang@gmail.com> <20150514143031.GA28717@treble.redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20150514143031.GA28717@treble.redhat.com> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 05/14/15 at 09:30am, Josh Poimboeuf wrote: > On Thu, May 14, 2015 at 09:51:07AM +0800, Minfei Huang wrote: > > @@ -891,22 +891,24 @@ static void klp_module_notify_coming(struct klp_patch *patch, > > int ret; > > > > ret = klp_init_object_loaded(patch, obj); > > - if (ret) > > - goto err; > > + if (ret) { > > + pr_warn("failed to initialize patch '%s' for module '%s' (%d)\n", > > + pmod->name, mod->name, ret); > > + goto out; > > + } > > > > if (patch->state == KLP_DISABLED) > > - return; > > + goto out; > > > > pr_notice("applying patch '%s' to loading module '%s'\n", > > pmod->name, mod->name); > > > > ret = klp_enable_object(obj); > > - if (!ret) > > - return; > > - > > -err: > > - pr_warn("failed to apply patch '%s' to module '%s' (%d)\n", > > - pmod->name, mod->name, ret); > > + if (ret) > > + pr_warn("failed to apply patch '%s' to module '%s' (%d)\n", > > + pmod->name, mod->name, ret); > > +out: > > + return ret; > > One more minor comment: the out label isn't needed. Instead of "goto > out", they can just return directly. Ok, I will remove the label "out" in the next version. Thanks Minfei > > Other than that, it looks good to me. > > Thanks! > > -- > Josh