Skip to content

Commit

Permalink
s390/module: fix compile warning
Browse files Browse the repository at this point in the history
Get rid of this one (false positive):
arch/s390/kernel/module.c: In function ‘apply_relocate_add’:
arch/s390/kernel/module.c:404:5: warning: ‘rc’ may be used uninitialized
                                 in this function [-Wmaybe-uninitialized]
arch/s390/kernel/module.c:225:6: note: ‘rc’ was declared here

Play safe and preinitialize rc with an error value, so we see an error
if new users indeed don't initialize it.

Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
  • Loading branch information
Heiko Carstens authored and Martin Schwidefsky committed Feb 28, 2013
1 parent aa2383f commit 72a6b43
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion arch/s390/kernel/module.c
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ static int apply_rela(Elf_Rela *rela, Elf_Addr base, Elf_Sym *symtab,
struct mod_arch_syminfo *info;
Elf_Addr loc, val;
int r_type, r_sym;
int rc;
int rc = -ENOEXEC;

/* This is where to make the change */
loc = base + rela->r_offset;
Expand Down

0 comments on commit 72a6b43

Please sign in to comment.