mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2026-07-08 18:13:59 +02:00
Input: synaptics-rmi4 - fix a locking bug in an error path
commit7adaaee5edupstream. 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:3a762dbd53("[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> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
3ac9c06f80
commit
86f10a3953
@@ -540,6 +540,8 @@ static void rmi_f54_work(struct work_struct *work)
|
||||
int error;
|
||||
int i;
|
||||
|
||||
mutex_lock(&f54->data_mutex);
|
||||
|
||||
report_size = rmi_f54_get_report_size(f54);
|
||||
if (report_size == 0) {
|
||||
dev_err(&fn->dev, "Bad report size, report type=%d\n",
|
||||
@@ -548,8 +550,6 @@ static void rmi_f54_work(struct work_struct *work)
|
||||
goto error; /* retry won't help */
|
||||
}
|
||||
|
||||
mutex_lock(&f54->data_mutex);
|
||||
|
||||
/*
|
||||
* Need to check if command has completed.
|
||||
* If not try again later.
|
||||
|
||||
Reference in New Issue
Block a user