From d841cab1af06c05d107963fa8ad879fcf72affac Mon Sep 17 00:00:00 2001 From: Ralf Baechle Date: Mon, 3 Aug 2009 12:26:40 +0100 Subject: [PATCH] --- yaml --- r: 156413 b: refs/heads/master c: 477c4b07406357ad93d0e32788dbf3ee814eadaa h: refs/heads/master i: 156411: b2ee60fddc4d23e6d4c3d2c20bb03a5e9138473d v: v3 --- [refs] | 2 +- trunk/arch/mips/kernel/vpe.c | 15 ++++++++++++--- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/[refs] b/[refs] index 73ed9b86f948..8c8ba24ae76a 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: e2a9cf96a0af24f33206b4bb98cc3a12242260c1 +refs/heads/master: 477c4b07406357ad93d0e32788dbf3ee814eadaa diff --git a/trunk/arch/mips/kernel/vpe.c b/trunk/arch/mips/kernel/vpe.c index 3d4ef841d829..245b03e88089 100644 --- a/trunk/arch/mips/kernel/vpe.c +++ b/trunk/arch/mips/kernel/vpe.c @@ -462,16 +462,15 @@ static int apply_r_mips_lo16(struct module *me, uint32_t *location, { unsigned long insnlo = *location; Elf32_Addr val, vallo; + struct mips_hi16 *l, *next; /* Sign extend the addend we extract from the lo insn. */ vallo = ((insnlo & 0xffff) ^ 0x8000) - 0x8000; if (mips_hi16_list != NULL) { - struct mips_hi16 *l; l = mips_hi16_list; while (l != NULL) { - struct mips_hi16 *next; unsigned long insn; /* @@ -481,7 +480,7 @@ static int apply_r_mips_lo16(struct module *me, uint32_t *location, printk(KERN_DEBUG "VPE loader: " "apply_r_mips_lo16/hi16: \t" "inconsistent value information\n"); - return -ENOEXEC; + goto out_free; } /* @@ -519,6 +518,16 @@ static int apply_r_mips_lo16(struct module *me, uint32_t *location, *location = insnlo; return 0; + +out_free: + while (l != NULL) { + next = l->next; + kfree(l); + l = next; + } + mips_hi16_list = NULL; + + return -ENOEXEC; } static int (*reloc_handlers[]) (struct module *me, uint32_t *location,