From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9F38A3ACF11; Wed, 8 Apr 2026 18:24:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775672659; cv=none; b=XMeSJP3BKNhNSXPu8q+quyOSe44JpfKj0owVcaN18UYUby2UKP9OKVWSqaqoII4FB66r/Y+dQo1sUEmchfUpEdU3K5D/+GfMQJALoCpjqDqjsTqmZ9TXrMAOKlW/4CMXdQ1MBQZ+sl1foK/Kqp4HcYIrpEoq55JK2aF5mCkxQZw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775672659; c=relaxed/simple; bh=k1q0xvXLzokHrNrhVNDy+qAMq73drfmfGi7EQVwaSxs=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=g6okB2/0k60u7z2NHuJYeQUWf1PUJIzrW15NG5SDLUD8SpcvMVaBWY18dkfPMEm/1oveglK5ftXiN7LC7OFYfL323s6mUYGGM+gdoVlqOoKBRbhtNKTbRK1IAZQJw7rA0kE/Q8BavbEJyVRG9NvJ9+iTFSvDTz7I+P0qTz4EKKo= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=z9A4ys4M; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="z9A4ys4M" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2FBEBC19421; Wed, 8 Apr 2026 18:24:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1775672659; bh=k1q0xvXLzokHrNrhVNDy+qAMq73drfmfGi7EQVwaSxs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=z9A4ys4MHNzKOngR2Oe6D6IG9Qkse90BmUEeLL1X87uPmdXIMdzN8fp7g9YNSyVNa Uib3cNCLPxuHAA4DcKY1Ik5XOsI31Xt3ffj4GHs8O9IxATuGLKMoKwZgLT0Mutk8ej KtdR2ANVqGfAaYJNUlqEV4oCiOaKRXsPMReGz9Ms= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Bart Van Assche , Dmitry Torokhov Subject: [PATCH 6.6 091/160] Input: synaptics-rmi4 - fix a locking bug in an error path Date: Wed, 8 Apr 2026 20:02:58 +0200 Message-ID: <20260408175916.591927733@linuxfoundation.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260408175913.177092714@linuxfoundation.org> References: <20260408175913.177092714@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.6-stable review patch. If anyone has any objections, please let me know. ------------------ From: Bart Van Assche commit 7adaaee5edd35a423ae199c41b86bd1ed60ed483 upstream. 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 Link: https://patch.msgid.link/20260223215118.2154194-16-bvanassche@acm.org Cc: stable@vger.kernel.org Signed-off-by: Dmitry Torokhov Signed-off-by: Greg Kroah-Hartman --- drivers/input/rmi4/rmi_f54.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) --- a/drivers/input/rmi4/rmi_f54.c +++ b/drivers/input/rmi4/rmi_f54.c @@ -540,6 +540,8 @@ static void rmi_f54_work(struct work_str 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_str goto error; /* retry won't help */ } - mutex_lock(&f54->data_mutex); - /* * Need to check if command has completed. * If not try again later.