summaryrefslogtreecommitdiff
path: root/fs
diff options
context:
space:
mode:
authorShyam Prasad N <sprasad@microsoft.com>2023-07-26 17:02:11 +0000
committerSteve French <stfrench@microsoft.com>2023-07-26 15:41:27 -0500
commita171eb5cac427fa8d084eaf5e47fbe4c0f1e279f (patch)
treeb2dda11ae18f8c3346c0bcdab0a5a53956bc95ad /fs
parent19826558210b9102a7d4681c91784d137d60d71b (diff)
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: b3edef6b9cd0 ("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>
Diffstat (limited to 'fs')
-rw-r--r--fs/smb/client/ioctl.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/fs/smb/client/ioctl.c b/fs/smb/client/ioctl.c
index e1904b86ed96..f7160003e0ed 100644
--- a/fs/smb/client/ioctl.c
+++ b/fs/smb/client/ioctl.c
@@ -478,6 +478,11 @@ long cifs_ioctl(struct file *filep, unsigned int command, unsigned long arg)
}
cifs_sb = CIFS_SB(inode->i_sb);
tlink = cifs_sb_tlink(cifs_sb);
+ if (IS_ERR(tlink)) {
+ rc = PTR_ERR(tlink);
+ break;
+ }
+
tcon = tlink_tcon(tlink);
rc = cifs_dump_full_key(tcon, (void __user *)arg);
cifs_put_tlink(tlink);