From: Jie Liu <[email protected]>

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 <[email protected]>
Cc: Bob Liu <[email protected]>
Cc: Greg Kroah-Hartman <[email protected]>
Cc: Konrad Rzeszutek Wilk <[email protected]>
Signed-off-by: Jie Liu <[email protected]>
---
 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 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);
 }
 
-- 
1.7.9.5
_______________________________________________
devel mailing list
[email protected]
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

Reply via email to