提交 10269f13 编写于 作者: Z Zhang Xiaoxu 提交者: Steve French

cifs: Fix xid leak in cifs_get_file_info_unix()

If stardup the symlink target failed, should free the xid,
otherwise the xid will be leaked.

Fixes: 76894f3e ("cifs: improve symlink handling for smb2+")
Reviewed-by: NPaulo Alcantara (SUSE) <pc@cjr.nz>
Signed-off-by: NZhang Xiaoxu <zhangxiaoxu5@huawei.com>
Signed-off-by: NSteve French <stfrench@microsoft.com>
上级 e909d054
......@@ -368,8 +368,10 @@ cifs_get_file_info_unix(struct file *filp)
if (cfile->symlink_target) {
fattr.cf_symlink_target = kstrdup(cfile->symlink_target, GFP_KERNEL);
if (!fattr.cf_symlink_target)
return -ENOMEM;
if (!fattr.cf_symlink_target) {
rc = -ENOMEM;
goto cifs_gfiunix_out;
}
}
rc = CIFSSMBUnixQFileInfo(xid, tcon, cfile->fid.netfid, &find_data);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册