diff mbox series

Input: ims-pcu - fix a mutex usage error

Message ID 20240921071501.263450-1-dolinux.peng@gmail.com (mailing list archive)
State New
Headers show
Series Input: ims-pcu - fix a mutex usage error | expand

Commit Message

Donglin Peng Sept. 21, 2024, 7:15 a.m. UTC
The mutex_lock_interruptible should be switched to scoped_cond_guard(mutex_intr, ...)
instead of scoped_cond_guard(mutex, ..).

Fixes: 703f12672e1f ("Input: ims-pcu - switch to using cleanup functions")
Signed-off-by: Donglin Peng <dolinux.peng@gmail.com>
---
 drivers/input/misc/ims-pcu.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Dmitry Torokhov Sept. 22, 2024, 7:58 a.m. UTC | #1
Hi Donglin,

On Sat, Sep 21, 2024 at 03:15:01PM +0800, Donglin Peng wrote:
> The mutex_lock_interruptible should be switched to scoped_cond_guard(mutex_intr, ...)
> instead of scoped_cond_guard(mutex, ..).

Thank you for the patch but I already got a fix for this issue:

https://lore.kernel.org/r/20240910-input-misc-ims-pcu-fix-mutex-intr-v1-1-bdd983685c43@baylibre.com

Thanks.
diff mbox series

Patch

diff --git a/drivers/input/misc/ims-pcu.c b/drivers/input/misc/ims-pcu.c
index c086dadb45e3..058f3470b7ae 100644
--- a/drivers/input/misc/ims-pcu.c
+++ b/drivers/input/misc/ims-pcu.c
@@ -1067,7 +1067,7 @@  static ssize_t ims_pcu_attribute_store(struct device *dev,
 	if (data_len > attr->field_length)
 		return -EINVAL;
 
-	scoped_cond_guard(mutex, return -EINTR, &pcu->cmd_mutex) {
+	scoped_cond_guard(mutex_intr, return -EINTR, &pcu->cmd_mutex) {
 		memset(field, 0, attr->field_length);
 		memcpy(field, buf, data_len);