Skip to content

Commit

Permalink
Fix wrong release_receiver_buffer before acquire
Browse files Browse the repository at this point in the history
Fix the issue: #2697

Signed-off-by: Wenxing Hou <[email protected]>
  • Loading branch information
Wenxing-hou committed Jun 18, 2024
1 parent b15d4ae commit c885c7a
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions library/spdm_requester_lib/libspdm_req_vendor_request.c
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,7 @@ libspdm_return_t libspdm_try_vendor_send_request_receive_response(
resp_size == NULL ||
(*resp_size != 0 && resp_data == NULL)
) {
status = LIBSPDM_STATUS_INVALID_PARAMETER;
goto done;
return LIBSPDM_STATUS_INVALID_PARAMETER;
}

if (spdm_context->connection_info.connection_state < LIBSPDM_CONNECTION_STATE_NEGOTIATED) {
Expand Down Expand Up @@ -122,8 +121,7 @@ libspdm_return_t libspdm_try_vendor_send_request_receive_response(
libspdm_send_spdm_request(spdm_context, session_id, spdm_request_size, spdm_request);
if (LIBSPDM_STATUS_IS_ERROR(status)) {
libspdm_release_sender_buffer (spdm_context);
status = LIBSPDM_STATUS_SEND_FAIL;
goto done;
return LIBSPDM_STATUS_SEND_FAIL;
}
libspdm_release_sender_buffer (spdm_context);
spdm_request = (void *)spdm_context->last_spdm_request;
Expand Down

0 comments on commit c885c7a

Please sign in to comment.