Skip to content

Commit 10269f1

Browse files
z00467499smfrench
authored andcommitted
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: 76894f3 ("cifs: improve symlink handling for smb2+") Reviewed-by: Paulo Alcantara (SUSE) <[email protected]> Signed-off-by: Zhang Xiaoxu <[email protected]> Signed-off-by: Steve French <[email protected]>
1 parent e909d05 commit 10269f1

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

fs/cifs/inode.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -368,8 +368,10 @@ cifs_get_file_info_unix(struct file *filp)
368368

369369
if (cfile->symlink_target) {
370370
fattr.cf_symlink_target = kstrdup(cfile->symlink_target, GFP_KERNEL);
371-
if (!fattr.cf_symlink_target)
372-
return -ENOMEM;
371+
if (!fattr.cf_symlink_target) {
372+
rc = -ENOMEM;
373+
goto cifs_gfiunix_out;
374+
}
373375
}
374376

375377
rc = CIFSSMBUnixQFileInfo(xid, tcon, cfile->fid.netfid, &find_data);

0 commit comments

Comments
 (0)