Skip to content

Commit 7357853

Browse files
committed
uninit var in kpatch-elf.c
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.
1 parent c63b28c commit 7357853

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

kpatch-build/kpatch-elf.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -215,13 +215,12 @@ static void rela_insn(const struct section *sec, const struct rela *rela,
215215
long rela_target_offset(struct kpatch_elf *kelf, struct section *relasec,
216216
struct rela *rela)
217217
{
218-
long add_off;
218+
long add_off = 0;
219219
struct section *sec = relasec->base;
220220

221221
switch(kelf->arch) {
222222
case AARCH64:
223223
case PPC64:
224-
add_off = 0;
225224
break;
226225
case X86_64:
227226
if (!is_text_section(sec) ||

0 commit comments

Comments
 (0)