Skip to content

Commit

Permalink
drivers: se050: Fix potential null pointer dereference
Browse files Browse the repository at this point in the history
Don't call sss_se05x_session_close() unless there is a valid session.

Acked-by: Jerome Forissier <[email protected]>
Signed-off-by: Donald Chan <[email protected]>
  • Loading branch information
hoihochan committed Sep 19, 2024
1 parent 3fc1691 commit 4fca423
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion core/drivers/crypto/se050/adaptors/apis/sss.c
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ sss_status_t se050_enable_scp03(sss_se05x_session_t *session)
if (status != kStatus_SSS_Success)
continue;

if (session->subsystem)
if (session && session->subsystem)
sss_se05x_session_close(session);

if (!se050_core_early_init(&keys)) {
Expand Down

0 comments on commit 4fca423

Please sign in to comment.