Skip to content

Commit

Permalink
staging: zcache: fix refcount leak
Browse files Browse the repository at this point in the history
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 <sjenning@linux.vnet.ibm.com>
Signed-off-by: Xiao Guangrong <xiaoguangrong@linux.vnet.ibm.com>
Acked-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
Xiao Guangrong authored and Greg Kroah-Hartman committed Jul 9, 2012
1 parent 47ec4ed commit 3045352
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion drivers/staging/zcache/zcache-main.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 3045352

Please sign in to comment.