[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20190905124514.8944-4-mbenes@suse.cz>
Date: Thu, 5 Sep 2019 14:45:14 +0200
From: Miroslav Benes <mbenes@...e.cz>
To: jikos@...nel.org, jpoimboe@...hat.com, pmladek@...e.com
Cc: joe.lawrence@...hat.com, nstange@...e.de,
live-patching@...r.kernel.org, linux-kernel@...r.kernel.org,
Miroslav Benes <mbenes@...e.cz>
Subject: [RFC PATCH v2 3/3] livepatch: Clean up klp_update_object_relocations() return paths
Signed-off-by: Miroslav Benes <mbenes@...e.cz>
---
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
Powered by blists - more mailing lists