OSDN Git Service
(root)
/
uclinux-h8
/
linux.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
cb32da0
)
UBI: fix memory leak in checking code
author
Artem Bityutskiy
<Artem.Bityutskiy@nokia.com>
Thu, 3 May 2007 08:59:51 +0000
(11:59 +0300)
committer
Artem Bityutskiy
<Artem.Bityutskiy@nokia.com>
Wed, 18 Jul 2007 13:52:13 +0000
(16:52 +0300)
Reported-by: Eric Sesterhenn / Snakebyte <snakebyte@gmx.de>
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
drivers/mtd/ubi/scan.c
patch
|
blob
|
history
diff --git
a/drivers/mtd/ubi/scan.c
b/drivers/mtd/ubi/scan.c
index
473f320
..
e445686
100644
(file)
--- a/
drivers/mtd/ubi/scan.c
+++ b/
drivers/mtd/ubi/scan.c
@@
-1310,8
+1310,10
@@
static int paranoid_check_si(const struct ubi_device *ubi,
memset(buf, 1, ubi->peb_count);
for (pnum = 0; pnum < ubi->peb_count; pnum++) {
err = ubi_io_is_bad(ubi, pnum);
- if (err < 0)
+ if (err < 0) {
+ kfree(buf);
return err;
+ }
else if (err)
buf[pnum] = 0;
}