]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
fs/ocfs2/cluster/tcp.c: free sc->sc_page in sc_kref_release()
authorYounger Liu <younger.liu@huawei.com>
Wed, 19 Jun 2013 00:05:40 +0000 (10:05 +1000)
committerStephen Rothwell <sfr@canb.auug.org.au>
Wed, 19 Jun 2013 07:12:49 +0000 (17:12 +1000)
There is a memory leak in sc_kref_release().  When free struct
o2net_sock_container (sc), we should release sc->sc_page.

Signed-off-by: Younger Liu <younger.liu@huawei.com>
Reviewed-by: Jie Liu <jeff.liu@oracle.com>
Cc: Joel Becker <jlbec@evilplan.org>
Cc: Mark Fasheh <mfasheh@suse.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
fs/ocfs2/cluster/tcp.c

index aa88bd8bcedc6733b89e1ceeb705adcfbb57242f..bb9a48bfbd01325e67e56a2567c260ca72caa55a 100644 (file)
@@ -406,6 +406,9 @@ static void sc_kref_release(struct kref *kref)
        sc->sc_node = NULL;
 
        o2net_debug_del_sc(sc);
+
+       if (sc->sc_page)
+               __free_page(sc->sc_page);
        kfree(sc);
 }