Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Input: synaptics-rmi4 - fix a locking bug in an error path

Lock f54->data_mutex when entering the function statement since jumping
to the 'error' label when checking report_size fails causes that mutex
to be unlocked.

This bug has been detected by the Clang thread-safety checker.

Fixes: 3a762dbd5347 ("[media] Input: synaptics-rmi4 - add support for F54 diagnostics")
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Link: https://patch.msgid.link/20260223215118.2154194-16-bvanassche@acm.org
Cc: stable@vger.kernel.org
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>

authored by

Bart Van Assche and committed by
Dmitry Torokhov
7adaaee5 5839419c

+2 -2
+2 -2
drivers/input/rmi4/rmi_f54.c
··· 538 538 int error; 539 539 int i; 540 540 541 + mutex_lock(&f54->data_mutex); 542 + 541 543 report_size = rmi_f54_get_report_size(f54); 542 544 if (report_size == 0) { 543 545 dev_err(&fn->dev, "Bad report size, report type=%d\n", ··· 547 545 error = -EINVAL; 548 546 goto error; /* retry won't help */ 549 547 } 550 - 551 - mutex_lock(&f54->data_mutex); 552 548 553 549 /* 554 550 * Need to check if command has completed.