提交 21d08bbc 编写于 作者: A Artem Bityutskiy

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: NArtem Bityutskiy <Artem.Bityutskiy@nokia.com>
上级 52b605d1
......@@ -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;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册