]> git.baikalelectronics.ru Git - kernel.git/commit
NFSD: Fix a memory leak in nfsd4_create_session
authorKinglong Mee <kinglongmee@gmail.com>
Tue, 31 Dec 2013 16:35:47 +0000 (00:35 +0800)
committerJ. Bruce Fields <bfields@redhat.com>
Mon, 6 Jan 2014 20:33:54 +0000 (15:33 -0500)
commit627f4f2dff348b33f050227531c1de7eed4cdc54
tree74bb2c76dfd59abd388551c63f406bce04e6f224
parent7fa82c0a70d2ebdd83b6a7a62624bcfb16a3e6c6
NFSD: Fix a memory leak in nfsd4_create_session

If failed after calling alloc_session but before init_session, nfsd will call __free_session to
free se_slots in session. But, session->se_fchannel.maxreqs is not initialized (value is zero).
So that, the memory malloced for slots will be lost in free_session_slots for maxreqs is zero.

This path sets the information for channel in alloc_session after mallocing slots succeed,
instead in init_session.

Signed-off-by: Kinglong Mee <kinglongmee@gmail.com>
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
fs/nfsd/nfs4state.c