cifs: convert to use ERR_CAST()
authorYuesong Li <liyuesong@vivo.com>
Thu, 29 Aug 2024 11:52:41 +0000 (19:52 +0800)
committerSteve French <stfrench@microsoft.com>
Sun, 15 Sep 2024 15:42:44 +0000 (10:42 -0500)
Use ERR_CAST() as it is designed for casting an error pointer to
another type.

This macro uses the __force and __must_check modifiers, which are used
to tell the compiler to check for errors where this macro is used.

Signed-off-by: Yuesong Li <liyuesong@vivo.com>
Signed-off-by: Steve French <stfrench@microsoft.com>
fs/smb/client/connect.c

index 5375b0c1dfb99d7fc90dc0432a67146f8d415484..098d51d0044c04605e38cec1cc32b2367d396109 100644 (file)
@@ -4081,7 +4081,7 @@ __cifs_construct_tcon(struct cifs_sb_info *cifs_sb, kuid_t fsuid)
 
        ses = cifs_get_smb_ses(master_tcon->ses->server, ctx);
        if (IS_ERR(ses)) {
-               tcon = (struct cifs_tcon *)ses;
+               tcon = ERR_CAST(ses);
                cifs_put_tcp_session(master_tcon->ses->server, 0);
                goto out;
        }