mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-08 11:50:43 +09:00
cifs: fix memory leak of pneg_inbuf on -EOPNOTSUPP ioctl case
commit210782038bupstream. 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:969ae8e8d4("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> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
f6a39f877f
commit
32d57c0c06
@@ -887,7 +887,8 @@ int smb3_validate_negotiate(const unsigned int xid, struct cifs_tcon *tcon)
|
||||
* not supported error. Client should accept it.
|
||||
*/
|
||||
cifs_dbg(VFS, "Server does not support validate negotiate\n");
|
||||
return 0;
|
||||
rc = 0;
|
||||
goto out_free_inbuf;
|
||||
} else if (rc != 0) {
|
||||
cifs_dbg(VFS, "validate protocol negotiate failed: %d\n", rc);
|
||||
rc = -EIO;
|
||||
|
||||
Reference in New Issue
Block a user