Skip to content

Commit

Permalink
uninit var in kpatch-elf.c
Browse files Browse the repository at this point in the history
Initialize add_off earlier, so it's obviously never used uninitialized.
Clang was warning on this, even if gcc was not.
No functional change, the only path which left it undefined would call
ERROR() anyway.
  • Loading branch information
swine committed Nov 13, 2023
1 parent c63b28c commit 7357853
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions kpatch-build/kpatch-elf.c
Original file line number Diff line number Diff line change
Expand Up @@ -215,13 +215,12 @@ static void rela_insn(const struct section *sec, const struct rela *rela,
long rela_target_offset(struct kpatch_elf *kelf, struct section *relasec,
struct rela *rela)
{
long add_off;
long add_off = 0;
struct section *sec = relasec->base;

switch(kelf->arch) {
case AARCH64:
case PPC64:
add_off = 0;
break;
case X86_64:
if (!is_text_section(sec) ||
Expand Down

0 comments on commit 7357853

Please sign in to comment.