]> git.baikalelectronics.ru Git - kernel.git/commit
SMB3: Fix potential memory leak when processing compound chain
authorPavel Shilovsky <pshilov@microsoft.com>
Mon, 22 Jul 2019 18:38:22 +0000 (11:38 -0700)
committerSteve French <stfrench@microsoft.com>
Tue, 6 Aug 2019 03:50:13 +0000 (22:50 -0500)
commit8e439435daa6a4f7915b1c35e9c6c4b297423671
tree6c4487f7274644d38f128e31e37bba38f9880085
parent1ecb329f413bae10a57747a26f85a102bdf5c8f5
SMB3: Fix potential memory leak when processing compound chain

When a reconnect happens in the middle of processing a compound chain
the code leaks a buffer from the memory pool. Fix this by properly
checking for a return code and freeing buffers in case of error.

Also maintain a buf variable to be equal to either smallbuf or bigbuf
depending on a response buffer size while parsing a chain and when
returning to the caller.

Signed-off-by: Pavel Shilovsky <pshilov@microsoft.com>
Reviewed-by: Ronnie Sahlberg <lsahlber@redhat.com>
Signed-off-by: Steve French <stfrench@microsoft.com>
fs/cifs/smb2ops.c