]> git.baikalelectronics.ru Git - kernel.git/commit
cifs: fix memory leak of pneg_inbuf on -EOPNOTSUPP ioctl case
authorColin Ian King <colin.king@canonical.com>
Fri, 17 May 2019 08:12:33 +0000 (09:12 +0100)
committerSteve French <stfrench@microsoft.com>
Wed, 29 May 2019 00:11:35 +0000 (19:11 -0500)
commit80323440127ccd439d3aaaeb24dfae6d3b4225fb
treebeebedc72c2076496d78a7c80092f6bcd39db28b
parent7f3e30282b380958e65348f1509b90f11030d416
cifs: fix memory leak of pneg_inbuf on -EOPNOTSUPP ioctl case

Currently in the case where SMB2_ioctl returns the -EOPNOTSUPP error
there is a memory leak of pneg_inbuf. Fix this by returning via
the out_free_inbuf exit path that will perform the relevant kfree.

Addresses-Coverity: ("Resource leak")
Fixes: 065fc3d17703 ("cifs: Accept validate negotiate if server return NT_STATUS_NOT_SUPPORTED")
CC: Stable <stable@vger.kernel.org> # v5.1+
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Steve French <stfrench@microsoft.com>
fs/cifs/smb2pdu.c