diff options
author | Artem Bityutskiy <Artem.Bityutskiy@nokia.com> | 2009-06-08 19:28:18 +0300 |
---|---|---|
committer | Artem Bityutskiy <Artem.Bityutskiy@nokia.com> | 2009-06-10 16:13:27 +0300 |
commit | 21d08bbcb19d9cdef8ab5b584f25b50d842068e9 (patch) | |
tree | a50210d1fe832fa9273483a6f4ba42102d8c3828 /drivers/mtd/ubi/wl.c | |
parent | 52b605d107de72c1d3385a3df972e79fb5befa4c (diff) | |
download | blackbird-obmc-linux-21d08bbcb19d9cdef8ab5b584f25b50d842068e9.tar.gz blackbird-obmc-linux-21d08bbcb19d9cdef8ab5b584f25b50d842068e9.zip |
UBI: fix kmem_cache_free on error patch
'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>
Diffstat (limited to 'drivers/mtd/ubi/wl.c')
-rw-r--r-- | drivers/mtd/ubi/wl.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/mtd/ubi/wl.c b/drivers/mtd/ubi/wl.c index f25ae2910ad0..acb5520f7f3d 100644 --- 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; } |