From fc6b626c6b6d17993764db9bc14c7c8457835854 Mon Sep 17 00:00:00 2001
From: Justin Chadwell <justin.chadwell@arm.com>
Date: Tue, 23 Jul 2019 09:54:07 +0100
Subject: [PATCH] Fix Coverity #343017, Missing unlock

All other returns from this function unlock the responses_lock, so we
also should release the lock in this case.

Change-Id: Ie2cfa8755723fed79e809f9480190d11f373a217
Signed-off-by: Justin Chadwell <justin.chadwell@arm.com>
---
 services/std_svc/spm/spm_buffers.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/services/std_svc/spm/spm_buffers.c b/services/std_svc/spm/spm_buffers.c
index 3e0c9496f..79398ba15 100644
--- a/services/std_svc/spm/spm_buffers.c
+++ b/services/std_svc/spm/spm_buffers.c
@@ -38,6 +38,8 @@ int spm_response_add(uint16_t client_id, uint16_t handle, uint32_t token,
 		struct sprt_response *resp = &(responses[i]);
 
 		if ((resp->is_valid == 1) && (resp->token == token)) {
+			spin_unlock(&responses_lock);
+
 			return -1;
 		}
 	}
-- 
GitLab