Skip to content

Commit a171eb5

Browse files
sprasad-microsoftSteve French
authored andcommitted
cifs: add missing return value check for cifs_sb_tlink
Whenever a tlink is obtained by cifs_sb_tlink, we need to check that the tlink returned is not an error. It was missing with the last change here. Fixes: b3edef6 ("cifs: allow dumping keys for directories too") Reported-by: Dan Carpenter <dan.carpenter@linaro.org> Signed-off-by: Shyam Prasad N <sprasad@microsoft.com> Signed-off-by: Steve French <stfrench@microsoft.com>
1 parent 1982655 commit a171eb5

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

fs/smb/client/ioctl.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -478,6 +478,11 @@ long cifs_ioctl(struct file *filep, unsigned int command, unsigned long arg)
478478
}
479479
cifs_sb = CIFS_SB(inode->i_sb);
480480
tlink = cifs_sb_tlink(cifs_sb);
481+
if (IS_ERR(tlink)) {
482+
rc = PTR_ERR(tlink);
483+
break;
484+
}
485+
481486
tcon = tlink_tcon(tlink);
482487
rc = cifs_dump_full_key(tcon, (void __user *)arg);
483488
cifs_put_tlink(tlink);

0 commit comments

Comments
 (0)