cifsd: simplify error handling in ksmbd_auth_ntlm()
authorNamjae Jeon <namjae.jeon@samsung.com>
Wed, 26 May 2021 06:28:09 +0000 (15:28 +0900)
committerNamjae Jeon <namjae.jeon@samsung.com>
Wed, 26 May 2021 09:12:11 +0000 (18:12 +0900)
simplify error handling in ksmbd_auth_ntlm().

Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Namjae Jeon <namjae.jeon@samsung.com>
Signed-off-by: Steve French <stfrench@microsoft.com>
fs/cifsd/auth.c

index 092db15..7771429 100644 (file)
@@ -351,12 +351,11 @@ int ksmbd_auth_ntlm(struct ksmbd_session *sess, char *pw_buf)
 
        if (strncmp(pw_buf, key, CIFS_AUTH_RESP_SIZE) != 0) {
                ksmbd_debug(AUTH, "ntlmv1 authentication failed\n");
-               rc = -EINVAL;
-       } else {
-               ksmbd_debug(AUTH, "ntlmv1 authentication pass\n");
+               return -EINVAL;
        }
 
-       return rc;
+       ksmbd_debug(AUTH, "ntlmv1 authentication pass\n");
+       return 0;
 }
 
 /**