From 3791b78401e2d04fd657f11443f51bb7719d6c0c Mon Sep 17 00:00:00 2001 From: Jon Lin Date: Mon, 2 Jun 2025 23:26:22 +0800 Subject: [PATCH] misc: rockchip: pcie-rkep: Fix mutex lock not released in pcie_rkep_release Change-Id: I4be295e6efb7509fc5b0d1610f2f6b2c480bbf5d Signed-off-by: Jon Lin --- drivers/misc/rockchip/pcie-rkep.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/misc/rockchip/pcie-rkep.c b/drivers/misc/rockchip/pcie-rkep.c index 4dbe0653f006..89fcabb86c96 100644 --- a/drivers/misc/rockchip/pcie-rkep.c +++ b/drivers/misc/rockchip/pcie-rkep.c @@ -351,8 +351,10 @@ static int pcie_rkep_release(struct inode *inode, struct file *file) mutex_lock(&pcie_file->file_lock_mutex); index = find_first_bit(pcie_file->child_vid_bitmap, RKEP_EP_VIRTUAL_ID_MAX); - if (index >= RKEP_EP_VIRTUAL_ID_MAX) + if (index >= RKEP_EP_VIRTUAL_ID_MAX) { + mutex_unlock(&pcie_file->file_lock_mutex); break; + } __clear_bit(index, pcie_file->child_vid_bitmap); mutex_unlock(&pcie_file->file_lock_mutex);