Linux MIPS Architecture development
 help / color / mirror / Atom feed
* [Memory leak]: memory leak in apply_r_mips_lo16_rel
@ 2012-08-03 22:29 Akhilesh Kumar
  2012-08-03 22:29 ` Akhilesh Kumar
  2012-08-08 13:04 ` Ralf Baechle
  0 siblings, 2 replies; 4+ messages in thread
From: Akhilesh Kumar @ 2012-08-03 22:29 UTC (permalink / raw)
  To: ralf; +Cc: paul.gortmaker, linux-mips

[-- Attachment #1: Type: text/plain, Size: 1120 bytes --]

Hi Ralf,

I found some memory leak in
arch/mips/kernel/module.c file

Please review below patch and share your review comments,

Thanks,
Akhilesh


>From 77b8cae374a95000a1fd7e75bcda6694b8180fe9 Mon Sep 17 00:00:00 2001
From: Akhilesh Kumar <akhilesh.lxr@gmail.com>
Date: Sat, 4 Aug 2012 03:34:06 +0530
Subject:  [Memory leak]: memory leak in  apply_r_mips_lo16_rel
 module.c

if (v != l->value)
             goto out_danger ;
out_danger:
  pr_err("module %s: dangerous R_MIPS_LO16 REL relocation\n", me->name);
  return -ENOEXEC;

in case goto_out_danger kfree(l) is missing

Signed-off-by: Akhilesh Kumar <akhilesh.lxr@gmail.com>
---
 arch/mips/kernel/module.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/arch/mips/kernel/module.c b/arch/mips/kernel/module.c
index a5066b1..b1dce44 100644
--- a/arch/mips/kernel/module.c
+++ b/arch/mips/kernel/module.c
@@ -202,7 +202,7 @@ static int apply_r_mips_lo16_rel(struct module *me, u32
*location, Elf_Addr v)

 out_danger:
  pr_err("module %s: dangerous R_MIPS_LO16 REL relocation\n", me->name);
-
+ kfree(l);
  return -ENOEXEC;
 }

-- 
1.7.8.4

[-- Attachment #2: Type: text/html, Size: 1930 bytes --]

^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2012-08-08 13:04 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-08-03 22:29 [Memory leak]: memory leak in apply_r_mips_lo16_rel Akhilesh Kumar
2012-08-03 22:29 ` Akhilesh Kumar
2012-08-08 13:04 ` Ralf Baechle
2012-08-08 13:04   ` Ralf Baechle

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox