]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
gpio: stmpe: Check return value of stmpe_reg_read in stmpe_gpio_irq_sync_unlock
authorWentao Liang <vulab@iscas.ac.cn>
Wed, 12 Feb 2025 02:18:49 +0000 (10:18 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 13 Mar 2025 11:50:41 +0000 (12:50 +0100)
commit4647cb4e001341aa0ed8b1e371ca2f95a904b018
tree4004a072bd48104bdb862aad6a5081ed50ca54a2
parentede3fa7b0cb6b3116cd1f3985ce3aea7b1bb013c
gpio: stmpe: Check return value of stmpe_reg_read in stmpe_gpio_irq_sync_unlock

commit b9644fbfbcab13da7f8b37bef7c51e5b8407d031 upstream.

The stmpe_reg_read function can fail, but its return value is not checked
in stmpe_gpio_irq_sync_unlock. This can lead to silent failures and
incorrect behavior if the hardware access fails.

This patch adds checks for the return value of stmpe_reg_read. If the
function fails, an error message is logged and the function returns
early to avoid further issues.

Fixes: b888fb6f2a27 ("gpio: stmpe: i2c transfer are forbiden in atomic context")
Cc: stable@vger.kernel.org # 4.16+
Signed-off-by: Wentao Liang <vulab@iscas.ac.cn>
Link: https://lore.kernel.org/r/20250212021849.275-1-vulab@iscas.ac.cn
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/gpio/gpio-stmpe.c