diff options
author | Jie Liu <jeff.liu@oracle.com> | 2013-08-04 20:06:20 +0800 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-08-05 14:41:46 +0800 |
commit | 98f62b7a082e1e9eb762c7329a704316f6e07698 (patch) | |
tree | 66abcdad49704e3a6e5e8a380a2b93efd987469c | |
parent | 6a48a9d5d7b6cedf9998d45105463a03cb15af13 (diff) | |
download | linux-stable-98f62b7a082e1e9eb762c7329a704316f6e07698.tar.gz linux-stable-98f62b7a082e1e9eb762c7329a704316f6e07698.tar.bz2 linux-stable-98f62b7a082e1e9eb762c7329a704316f6e07698.zip |
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 <younger.liu@huawei.com>
Cc: Bob Liu <bob.liu@oracle.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Signed-off-by: Jie Liu <jeff.liu@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r-- | drivers/staging/zcache/ramster/tcp.c | 3 |
1 files changed, 3 insertions, 0 deletions
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); } |