Skip to content

Commit fee0fb1

Browse files
z00467499smfrench
authored andcommitted
cifs: Fix xid leak in cifs_create()
If the cifs already shutdown, we should free the xid before return, otherwise, the xid will be leaked. Fixes: 087f757 ("cifs: add shutdown support") Reviewed-by: Paulo Alcantara (SUSE) <[email protected]> Signed-off-by: Zhang Xiaoxu <[email protected]> Signed-off-by: Steve French <[email protected]>
1 parent 9abf231 commit fee0fb1

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

fs/cifs/dir.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -543,8 +543,10 @@ int cifs_create(struct user_namespace *mnt_userns, struct inode *inode,
543543
cifs_dbg(FYI, "cifs_create parent inode = 0x%p name is: %pd and dentry = 0x%p\n",
544544
inode, direntry, direntry);
545545

546-
if (unlikely(cifs_forced_shutdown(CIFS_SB(inode->i_sb))))
547-
return -EIO;
546+
if (unlikely(cifs_forced_shutdown(CIFS_SB(inode->i_sb)))) {
547+
rc = -EIO;
548+
goto out_free_xid;
549+
}
548550

549551
tlink = cifs_sb_tlink(CIFS_SB(inode->i_sb));
550552
rc = PTR_ERR(tlink);

0 commit comments

Comments
 (0)