Fix Coverity #343017, Missing unlock
authorJustin Chadwell <justin.chadwell@arm.com>
Tue, 23 Jul 2019 08:54:07 +0000 (09:54 +0100)
committerJustin Chadwell <justin.chadwell@arm.com>
Tue, 6 Aug 2019 12:06:03 +0000 (13:06 +0100)
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

index 3e0c9496fce0244a63663f572c0d7e1d34e430f7..79398ba151e03a13357ad15ba0a4be4ec8c6d62c 100644 (file)
@@ -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;
                }
        }