From 98f62b7a082e1e9eb762c7329a704316f6e07698 Mon Sep 17 00:00:00 2001 From: Jie Liu Date: Sun, 4 Aug 2013 20:06:20 +0800 Subject: [PATCH] staging/zcache: Fix memory leak while dropping an o2net_sock_container object Free sc->sc_page when releasing a struct o2net_sock_container object to avoid memory leaks. This issue has been fixed by Younger Liu for OCFS2, so I sync that patch to zcache as we share the same network code base. Cc: Younger Liu Cc: Bob Liu Cc: Greg Kroah-Hartman Cc: Konrad Rzeszutek Wilk Signed-off-by: Jie Liu Signed-off-by: Greg Kroah-Hartman --- drivers/staging/zcache/ramster/tcp.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/staging/zcache/ramster/tcp.c b/drivers/staging/zcache/ramster/tcp.c index f6e1e5209d88..f74881e09342 100644 --- a/drivers/staging/zcache/ramster/tcp.c +++ b/drivers/staging/zcache/ramster/tcp.c @@ -403,6 +403,9 @@ static void sc_kref_release(struct kref *kref) sc->sc_node = NULL; r2net_debug_del_sc(sc); + + if (sc->sc_page) + __free_page(sc->sc_page); kfree(sc); } -- 2.30.2