lkml.org 
[lkml]   [2019]   [Sep]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[RFC PATCH v2 3/3] livepatch: Clean up klp_update_object_relocations() return paths
Date
Signed-off-by: Miroslav Benes <mbenes@suse.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
\
 
 \ /
  Last update: 2019-09-05 14:47    [W:0.067 / U:3.556 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site