Commit fc1bd51d authored by Paulo Alcantara's avatar Paulo Alcantara Committed by Steve French

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/202306170124.CtQqzf0I-lkp@intel.com/Signed-off-by: default avatarPaulo Alcantara (SUSE) <pc@manguebit.com>
Signed-off-by: default avatarSteve French <stfrench@microsoft.com>
parent dc765027
...@@ -2767,8 +2767,9 @@ cifs_match_super(struct super_block *sb, void *data) ...@@ -2767,8 +2767,9 @@ cifs_match_super(struct super_block *sb, void *data)
} }
tlink = cifs_get_tlink(cifs_sb_master_tlink(cifs_sb)); tlink = cifs_get_tlink(cifs_sb_master_tlink(cifs_sb));
if (tlink == NULL) { if (IS_ERR_OR_NULL(tlink)) {
/* can not match superblock if tlink were ever null */ pr_warn_once("%s: skip super matching due to bad tlink(%p)\n",
__func__, tlink);
spin_unlock(&cifs_tcp_ses_lock); spin_unlock(&cifs_tcp_ses_lock);
return 0; return 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment