File tree Expand file tree Collapse file tree 1 file changed +12
-2
lines changed Expand file tree Collapse file tree 1 file changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -824,8 +824,13 @@ EXPORT_SYMBOL(tpm_buf_check_hmac_response);
824
824
*/
825
825
void tpm2_end_auth_session (struct tpm_chip * chip )
826
826
{
827
- tpm2_flush_context (chip , chip -> auth -> handle );
828
- memzero_explicit (chip -> auth , sizeof (* chip -> auth ));
827
+ struct tpm2_auth * auth = chip -> auth ;
828
+
829
+ if (!auth )
830
+ return ;
831
+
832
+ tpm2_flush_context (chip , auth -> handle );
833
+ memzero_explicit (auth , sizeof (* auth ));
829
834
}
830
835
EXPORT_SYMBOL (tpm2_end_auth_session );
831
836
@@ -907,6 +912,11 @@ int tpm2_start_auth_session(struct tpm_chip *chip)
907
912
int rc ;
908
913
u32 null_key ;
909
914
915
+ if (!auth ) {
916
+ dev_warn_once (& chip -> dev , "auth session is not active\n" );
917
+ return 0 ;
918
+ }
919
+
910
920
rc = tpm2_load_null (chip , & null_key );
911
921
if (rc )
912
922
goto out ;
You can’t perform that action at this time.
0 commit comments