From: Jie Liu Date: Sun, 4 Aug 2013 12:06:20 +0000 (+0800) Subject: staging/zcache: Fix memory leak while dropping an o2net_sock_container object X-Git-Tag: v3.12-rc1~183^2~320 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=98f62b7a082e1e9eb762c7329a704316f6e07698;p=kernel%2Fkernel-generic.git 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 --- diff --git a/drivers/staging/zcache/ramster/tcp.c b/drivers/staging/zcache/ramster/tcp.c index f6e1e52..f74881e 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); }