Thread (6 messages) 6 messages, 3 authors, 2012-07-09

Re: [PATCH v2 1/9] zcache: fix refcount leak

From: Konrad Rzeszutek Wilk <hidden>
Date: 2012-06-26 22:36:56

On Tue, Jun 26, 2012 at 04:49:46PM +0800, Xiao Guangrong wrote:
In zcache_get_pool_by_id, the refcount of zcache_host is not increased, but
it is always decreased in zcache_put_pool
All of the patches (1-9) look good to me, so please also
affix 'Reviewed-by: Konrad Rzeszutek Wilk [off-list ref]'.

You also might want to send this patch series with Greg KH being
on the To line- not just as CC -as he is the one committing the
patches in the git tree.
quoted hunk ↗ jump to hunk
Acked-by: Seth Jennings <redacted>
Signed-off-by: Xiao Guangrong <redacted>
---
 drivers/staging/zcache/zcache-main.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
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);
-- 
1.7.7.6

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help