Fixed a linked list manipulation bug.

Consider the case where you start with A->B->C and you remove B. Before
this fix, both A and B were removed from the list. This resulted in a
dangling reference to A in the key manager and invalid key handle errors
when A was next referenced. Also this resulted in A not being evicted /
flushed from the TPM when Tspi_Key_UnloadKey was called.

BUG=None
TEST=Run the platform_Pkcs11Events autotest.

Change-Id: If1fd6612ae13a6a1f558a9dcaa8e36f9b5eea577
Reviewed-on: https://gerrit.chromium.org/gerrit/24241
Reviewed-by: Gaurav Shah <gauravsh@chromium.org>
Tested-by: Darren Krahn <dkrahn@chromium.org>
Commit-Ready: Darren Krahn <dkrahn@chromium.org>
1 file changed