From e6e9f4da68ff502000048975ed6ad5b7f752f280 Mon Sep 17 00:00:00 2001 From: Yonghua Huang Date: Tue, 15 Oct 2019 13:40:20 +0800 Subject: [PATCH] dm: fix mutex lock issue in tpm_rbc.c In function crb_reg_write() in tpm_rbc.c 'tpm_vdev->request_mutex' will potentially kept in locked state after crb_reg_write() returns. Tracked-On: #4108 Signed-off-by: Yonghua Huang Reviewed-by: Yadong Qi Acked-by: Yu Wang --- devicemodel/hw/platform/tpm/tpm_crb.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/devicemodel/hw/platform/tpm/tpm_crb.c b/devicemodel/hw/platform/tpm/tpm_crb.c index 7c7241697..f0c0cbb10 100644 --- a/devicemodel/hw/platform/tpm/tpm_crb.c +++ b/devicemodel/hw/platform/tpm/tpm_crb.c @@ -329,12 +329,10 @@ static void crb_reg_write(struct tpm_crb_vdev *tpm_vdev, uint64_t addr, int size if (pthread_cond_signal(&tpm_vdev->request_cond)) { DPRINTF("ERROR: Failed to wait condition\n"); - break; } if (pthread_mutex_unlock(&tpm_vdev->request_mutex)) { DPRINTF("ERROR: Failed to release mutex lock\n"); - break; } } break;