Skip to content

Commit 055d79a

Browse files
krzkandersson
authored andcommitted
firmware: qcom: uefisecapp: Simplify mutex with guard
Simplify error path unlocking mutex with the guard. Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com> Reviewed-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com> Link: https://lore.kernel.org/r/20260216091525.107935-4-krzysztof.kozlowski@oss.qualcomm.com Signed-off-by: Bjorn Andersson <andersson@kernel.org>
1 parent 5a67943 commit 055d79a

1 file changed

Lines changed: 2 additions & 5 deletions

File tree

drivers/firmware/qcom/qcom_qseecom_uefisecapp.c

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -699,16 +699,13 @@ static DEFINE_MUTEX(__qcuefi_lock);
699699

700700
static int qcuefi_set_reference(struct qcuefi_client *qcuefi)
701701
{
702-
mutex_lock(&__qcuefi_lock);
702+
guard(mutex)(&__qcuefi_lock);
703703

704-
if (qcuefi && __qcuefi) {
705-
mutex_unlock(&__qcuefi_lock);
704+
if (qcuefi && __qcuefi)
706705
return -EEXIST;
707-
}
708706

709707
__qcuefi = qcuefi;
710708

711-
mutex_unlock(&__qcuefi_lock);
712709
return 0;
713710
}
714711

0 commit comments

Comments
 (0)