summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEric Sesterhenn <eric.sesterhenn@focus-voip.de>2009-07-28 14:32:08 +0200
committerJ. Bruce Fields <bfields@citi.umich.edu>2009-07-28 14:29:34 -0400
commit2522a776c1b9b5c93383d07717f895cc1a56a87a (patch)
tree1233866afaa4d6caf135f4714c30dd3c8f2cb270
parent4bd9b0f4afc76cf972578c702e1bc1b6f2d10ba5 (diff)
downloadlinux-2522a776c1b9b5c93383d07717f895cc1a56a87a.tar.bz2
Fix memory leak in write_pool_threads
kmemleak produces the following warning unreferenced object 0xc9ec02a0 (size 8): comm "cat", pid 19048, jiffies 730243 backtrace: [<c01bf970>] create_object+0x100/0x240 [<c01bfadb>] kmemleak_alloc+0x2b/0x60 [<c01bcd4b>] __kmalloc+0x14b/0x270 [<c02fd027>] write_pool_threads+0x87/0x1d0 [<c02fcc08>] nfsctl_transaction_write+0x58/0x70 [<c02fcc6f>] nfsctl_transaction_read+0x4f/0x60 [<c01c2574>] vfs_read+0x94/0x150 [<c01c297d>] sys_read+0x3d/0x70 [<c0102d6b>] sysenter_do_call+0x12/0x32 [<ffffffff>] 0xffffffff write_pool_threads() only frees nthreads on error paths, in the success case we leak it. Signed-off-by: Eric Sesterhenn <eric.sesterhenn@lsexperts.de> Reviewed-by: Catalin Marinas <catalin.marinas@arm.com> Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu>
-rw-r--r--fs/nfsd/nfsctl.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/fs/nfsd/nfsctl.c b/fs/nfsd/nfsctl.c
index 1250fb978ac1..48da164bb597 100644
--- a/fs/nfsd/nfsctl.c
+++ b/fs/nfsd/nfsctl.c
@@ -785,6 +785,7 @@ static ssize_t write_pool_threads(struct file *file, char *buf, size_t size)
mesg += len;
}
+ kfree(nthreads);
mutex_unlock(&nfsd_mutex);
return (mesg-buf);