diff options
author | 2011-02-10 21:00:39 +0300 | |
---|---|---|
committer | 2011-02-18 13:24:53 -0800 | |
commit | 69648bed5383d5e9454aa9dc922dee4db2eef794 (patch) | |
tree | 703be1fbfb7dce7a44a36aae63cbc967610ee7bd /drivers/staging/zcache | |
parent | staging:iio:gyro:adis16130 stub removal and cleanup (diff) | |
download | linux-69648bed5383d5e9454aa9dc922dee4db2eef794.tar.gz linux-69648bed5383d5e9454aa9dc922dee4db2eef794.tar.bz2 linux-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(); |