From dd7adcf3a89a75973a88118eeb867d1c212c4ad0 Mon Sep 17 00:00:00 2001 From: Sieu Mun Tang Date: Mon, 4 Jul 2022 22:34:32 +0800 Subject: [PATCH] fix(intel): fix asynchronous read response by copying data to input buffer To fix that response should not be NULL when there is response data need to be sent to input buffer by SDM. Signed-off-by: Sieu Mun Tang Change-Id: Id70289521792f5f995456d2e67e18f0185ca3fc0 --- plat/intel/soc/common/soc/socfpga_mailbox.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plat/intel/soc/common/soc/socfpga_mailbox.c b/plat/intel/soc/common/soc/socfpga_mailbox.c index 778d4af3c..79817e64c 100644 --- a/plat/intel/soc/common/soc/socfpga_mailbox.c +++ b/plat/intel/soc/common/soc/socfpga_mailbox.c @@ -236,7 +236,7 @@ int mailbox_read_response_async(unsigned int *job_id, uint32_t *header, /* copy response data to input buffer if applicable */ ret_resp_len = MBOX_RESP_LEN(mailbox_resp_ctr.payload->header); - if ((ret_resp_len > 0) && (response == NULL) && resp_len) { + if ((ret_resp_len > 0) && (response != NULL) && (resp_len != NULL)) { if (*resp_len > ret_resp_len) { *resp_len = ret_resp_len; } -- 2.39.5