projects
/
firefly-linux-kernel-4.4.55.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
52b605d
)
UBI: fix kmem_cache_free on error patch
author
Artem Bityutskiy
<Artem.Bityutskiy@nokia.com>
Mon, 8 Jun 2009 16:28:18 +0000
(19:28 +0300)
committer
Artem Bityutskiy
<Artem.Bityutskiy@nokia.com>
Wed, 10 Jun 2009 13:13:27 +0000
(16:13 +0300)
'kmem_cache_free()' oopeses if NULL is passed, and there is
one error-path place where UBI may call it with NULL object.
This problem was pointed to by Adrian Hunter.
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
drivers/mtd/ubi/wl.c
patch
|
blob
|
history
diff --git
a/drivers/mtd/ubi/wl.c
b/drivers/mtd/ubi/wl.c
index f25ae2910ad0ddd0c0532597286b4e1f541d0fc0..acb5520f7f3dc7cf5bee0ed9c77609100108fa79 100644
(file)
--- a/
drivers/mtd/ubi/wl.c
+++ b/
drivers/mtd/ubi/wl.c
@@
-826,7
+826,8
@@
static int wear_leveling_worker(struct ubi_device *ubi, struct ubi_work *wrk,
err = schedule_erase(ubi, e1, 0);
if (err) {
kmem_cache_free(ubi_wl_entry_slab, e1);
- kmem_cache_free(ubi_wl_entry_slab, e2);
+ if (e2)
+ kmem_cache_free(ubi_wl_entry_slab, e2);
goto out_ro;
}