Skip to content

Commit db213b0

Browse files
Dan Carpenterandersson
authored andcommitted
firmware: qcom: uefisecapp: Fix deadlock in qcuefi_acquire()
If the __qcuefi pointer is not set, then in the original code, we would hold onto the lock. That means that if we tried to set it later, then it would cause a deadlock. Drop the lock on the error path. That's what all the callers are expecting. Fixes: 759e7a2 ("firmware: Add support for Qualcomm UEFI Secure Application") Signed-off-by: Dan Carpenter <[email protected]> Reviewed-by: Dmitry Baryshkov <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Bjorn Andersson <[email protected]>
1 parent c158ceb commit db213b0

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

drivers/firmware/qcom/qcom_qseecom_uefisecapp.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -715,6 +715,10 @@ static int qcuefi_set_reference(struct qcuefi_client *qcuefi)
715715
static struct qcuefi_client *qcuefi_acquire(void)
716716
{
717717
mutex_lock(&__qcuefi_lock);
718+
if (!__qcuefi) {
719+
mutex_unlock(&__qcuefi_lock);
720+
return NULL;
721+
}
718722
return __qcuefi;
719723
}
720724

0 commit comments

Comments
 (0)