From: Paulo Alcantara Date: Wed, 4 Jul 2018 17:16:16 +0000 (-0300) Subject: cifs: Fix memory leak in smb2_set_ea() X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=f5f485d888d541431ce40aa1e6bc3ae95bd5ae91;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git cifs: Fix memory leak in smb2_set_ea() commit 6aa0c114eceec8cc61715f74a4ce91b048d7561c upstream. This patch fixes a memory leak when doing a setxattr(2) in SMB2+. Signed-off-by: Paulo Alcantara Cc: stable@vger.kernel.org Signed-off-by: Steve French Reviewed-by: Aurelien Aptel Signed-off-by: Greg Kroah-Hartman --- diff --git a/fs/cifs/smb2ops.c b/fs/cifs/smb2ops.c index 51d69473dbd9..83267ac3a3f0 100644 --- a/fs/cifs/smb2ops.c +++ b/fs/cifs/smb2ops.c @@ -636,6 +636,8 @@ smb2_set_ea(const unsigned int xid, struct cifs_tcon *tcon, rc = SMB2_set_ea(xid, tcon, fid.persistent_fid, fid.volatile_fid, ea, len); + kfree(ea); + SMB2_close(xid, tcon, fid.persistent_fid, fid.volatile_fid); return rc;