From: Xiao Guangrong Date: Tue, 26 Jun 2012 08:49:46 +0000 (+0800) Subject: staging: zcache: fix refcount leak X-Git-Tag: v3.6-rc1~100^2~376 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=30453529bc17161fd863093ebf7a4bfce9820159;p=platform%2Fkernel%2Flinux-3.10.git staging: zcache: fix refcount leak In zcache_get_pool_by_id, the refcount of zcache_host is not increased, but it is always decreased in zcache_put_pool Acked-by: Seth Jennings Signed-off-by: Xiao Guangrong Acked-by: Konrad Rzeszutek Wilk Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/zcache/zcache-main.c b/drivers/staging/zcache/zcache-main.c index c9e08bb..55fbe3d 100644 --- a/drivers/staging/zcache/zcache-main.c +++ b/drivers/staging/zcache/zcache-main.c @@ -946,8 +946,9 @@ static struct tmem_pool *zcache_get_pool_by_id(uint16_t cli_id, uint16_t poolid) cli = &zcache_clients[cli_id]; if (cli == NULL) goto out; - atomic_inc(&cli->refcount); } + + atomic_inc(&cli->refcount); pool = idr_find(&cli->tmem_pools, poolid); if (pool != NULL) atomic_inc(&pool->refcount);