Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp994635ybe; Thu, 5 Sep 2019 08:50:11 -0700 (PDT) X-Google-Smtp-Source: APXvYqyzFiYp6gyGTjLPX26sb1GiocMgJ5C6OPnwEkHRlD9c74VziyW5dr1/2x80KKw9aeGj0p96 X-Received: by 2002:a17:902:b7cb:: with SMTP id v11mr4113688plz.153.1567698611136; Thu, 05 Sep 2019 08:50:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567698611; cv=none; d=google.com; s=arc-20160816; b=vd6cdt+LO2kwqZoN7boOkGt/s8wDV7uu5zPPTJ7aedA/gcnYut7meN8dAzpIpwJfVQ SUjRUHavhzdGQbgdARSktqFqJXlU0JRc1lajfWnVrKQfsCcOD9eH32ybMkvLjIcoSv3o IZ4iDKO7cfQ3CiqSDQJ2zVGSBPGc1QNOQ8dIDWHJpTIGPcQmfG2likPlPnyte2Qo6Tgy 1drCMc4Dwhzrl5VcPhF4GDICKU062vQp9JaA7rlskZGt06yPumijBd5kaA5SZ2MoePMi xvPTbVUF4q33V/Wcvn2JG5nLbDcvxaDkxF3pyZWvvfP4zNMqb+6ywG2/lP+thoTVfc3W 6vyw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=HfNlUPaymJbdwak/SZpAHRpGDc/H9LWZU5sIaZGqoO8=; b=BxaQ6LVccyeKTwIESfnGQR3IFICqQILeHJp88Jza1zS0ECPpTfsCpsh0MPyc5VKYC6 gnazyvA+uALxf6I2fE73smR3jTTnMSFla9SEGIsYsrOu6emgvaEe7NFQR4OIREGqftcv NJErvP9rTpF0Aqk7G7MqxNOEY1xTEq1CRELBz1ZtlfF3R+R95TBsruEfJDbshhrCdZH0 5CdEUCTYW97/vKX+71cb4JCgcmZcyf/4o4YIKZl4dp1nb+8QxXy9OZ7BNHs7JO0yC+hR 7jCS90vW3rV5L0hcIc29MesmO8kOaSj4dCkmWFdXr36VBF/EZo5gxZqCHtw77hfF9aAd +aPw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id az22si1174958pjb.7.2019.09.05.08.49.54; Thu, 05 Sep 2019 08:50:11 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389498AbfIEMpW (ORCPT + 99 others); Thu, 5 Sep 2019 08:45:22 -0400 Received: from mx2.suse.de ([195.135.220.15]:40694 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1731301AbfIEMpS (ORCPT ); Thu, 5 Sep 2019 08:45:18 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id A4742B0BA; Thu, 5 Sep 2019 12:45:17 +0000 (UTC) From: Miroslav Benes To: jikos@kernel.org, jpoimboe@redhat.com, pmladek@suse.com Cc: joe.lawrence@redhat.com, nstange@suse.de, live-patching@vger.kernel.org, linux-kernel@vger.kernel.org, Miroslav Benes Subject: [RFC PATCH v2 3/3] livepatch: Clean up klp_update_object_relocations() return paths Date: Thu, 5 Sep 2019 14:45:14 +0200 Message-Id: <20190905124514.8944-4-mbenes@suse.cz> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20190905124514.8944-1-mbenes@suse.cz> References: <20190905124514.8944-1-mbenes@suse.cz> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Signed-off-by: Miroslav Benes --- kernel/livepatch/core.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/kernel/livepatch/core.c b/kernel/livepatch/core.c index 023c9333c276..73ddddd5add5 100644 --- a/kernel/livepatch/core.c +++ b/kernel/livepatch/core.c @@ -251,7 +251,7 @@ static int klp_update_object_relocations(struct module *pmod, struct klp_object *obj, reloc_update_fn_t reloc_update_fn) { - int i, cnt, ret = 0; + int i, cnt, ret; const char *objname, *secname; char sec_objname[MODULE_NAME_LEN]; Elf_Shdr *sec; @@ -277,8 +277,7 @@ static int klp_update_object_relocations(struct module *pmod, if (cnt != 1) { pr_err("section %s has an incorrectly formatted name\n", secname); - ret = -EINVAL; - break; + return -EINVAL; } if (strcmp(objname, sec_objname)) @@ -286,10 +285,10 @@ static int klp_update_object_relocations(struct module *pmod, ret = reloc_update_fn(pmod, i); if (ret) - break; + return ret; } - return ret; + return 0; } /* -- 2.23.0