diff options
author | Vasiliy Kulikov <segoon@openwall.com> | 2011-02-10 21:00:39 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2011-02-18 13:24:53 -0800 |
commit | 69648bed5383d5e9454aa9dc922dee4db2eef794 (patch) | |
tree | 703be1fbfb7dce7a44a36aae63cbc967610ee7bd /drivers/staging/zcache | |
parent | 7a9f437af97110ed7beaceb5932ad8d3aa6e519d (diff) | |
download | linux-stable-69648bed5383d5e9454aa9dc922dee4db2eef794.tar.gz linux-stable-69648bed5383d5e9454aa9dc922dee4db2eef794.tar.bz2 linux-stable-69648bed5383d5e9454aa9dc922dee4db2eef794.zip |
staging: zcache: fix memory leak
obj is not freed if __get_free_page() failed.
Signed-off-by: Vasiliy Kulikov <segoon@openwall.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/staging/zcache')
-rw-r--r-- | drivers/staging/zcache/zcache.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/staging/zcache/zcache.c b/drivers/staging/zcache/zcache.c index 61be8498fb06..b8a2b30a1572 100644 --- a/drivers/staging/zcache/zcache.c +++ b/drivers/staging/zcache/zcache.c @@ -790,6 +790,7 @@ static int zcache_do_preload(struct tmem_pool *pool) page = (void *)__get_free_page(ZCACHE_GFP_MASK); if (unlikely(page == NULL)) { zcache_failed_get_free_pages++; + kmem_cache_free(zcache_obj_cache, obj); goto unlock_out; } preempt_disable(); |