Skip to content

Commit fc1bd51

Browse files
Paulo Alcantarasmfrench
authored andcommitted
smb: client: fix warning in cifs_match_super()
Fix potential dereference of ERR_PTR @tlink as reported by kernel test robot fs/smb/client/connect.c:2775 cifs_match_super() error: 'tlink' dereferencing possible ERR_PTR() Link: https://lore.kernel.org/all/[email protected]/ Signed-off-by: Paulo Alcantara (SUSE) <[email protected]> Signed-off-by: Steve French <[email protected]>
1 parent dc76502 commit fc1bd51

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

fs/smb/client/connect.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2767,8 +2767,9 @@ cifs_match_super(struct super_block *sb, void *data)
27672767
}
27682768

27692769
tlink = cifs_get_tlink(cifs_sb_master_tlink(cifs_sb));
2770-
if (tlink == NULL) {
2771-
/* can not match superblock if tlink were ever null */
2770+
if (IS_ERR_OR_NULL(tlink)) {
2771+
pr_warn_once("%s: skip super matching due to bad tlink(%p)\n",
2772+
__func__, tlink);
27722773
spin_unlock(&cifs_tcp_ses_lock);
27732774
return 0;
27742775
}

0 commit comments

Comments
 (0)