linux/drivers/input/keyboard
Gary Bisson 90fa6015ff Input: mtk-pmic-keys - fix possible null pointer dereference
commit 11cdb506d0 upstream.

In mtk_pmic_keys_probe, the regs parameter is only set if the button is
parsed in the device tree. However, on hardware where the button is left
floating, that node will most likely be removed not to enable that
input. In that case the code will try to dereference a null pointer.

Let's use the regs struct instead as it is defined for all supported
platforms. Note that it is ok setting the key reg even if that latter is
disabled as the interrupt won't be enabled anyway.

Fixes: b581acb49a ("Input: mtk-pmic-keys - transfer per-key bit in mtk_pmic_keys_regs")
Signed-off-by: Gary Bisson <bisson.gary@gmail.com>
Cc: stable@vger.kernel.org
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
History 2025-05-18 08:24:06 +02:00
..
adc-keys.c Input: adc-keys - drop bogus __refdata annotation 2021-09-03 23:49:58 -07:00
adp5520-keys.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 149 2019-05-30 11:25:18 -07:00
adp5588-keys.c Input: adp5588-keys - fix check on return code 2024-10-04 16:29:46 +02:00
adp5589-keys.c Input: adp5589-keys - fix adp5589_gpio_get_value() 2024-10-10 11:57:57 +02:00
amikbd.c Input: amikbd - convert to use devm_* api 2023-07-20 16:52:48 -07:00
applespi.c Input: applespi - use pm_sleep_ptr() and SYSTEM_SLEEP_PM_OPS() 2023-01-27 14:49:53 -08:00
applespi.h Input: add Apple SPI keyboard and trackpad driver 2019-07-19 11:58:34 +03:00
applespi_trace.h Input: add Apple SPI keyboard and trackpad driver 2019-07-19 11:58:34 +03:00
atakbd.c input: drop empty comment blocks 2022-09-29 16:25:42 -07:00
atkbd.c Input: atkbd - map F23 key to support default copilot shortcut 2025-02-01 18:37:56 +01:00
bcm-keypad.c Input: bcm-keypad - correct dev_err_probe() error 2023-07-12 11:54:19 -07:00
cap11xx.c Input: Switch i2c drivers back to use .probe() 2023-05-17 09:59:11 -07:00
clps711x-keypad.c Input: clps711x-keypad - get rid of OF_GPIO dependency 2022-08-30 14:20:00 -07:00
cros_ec_keyb.c Input: cros_ec_keyb - add 3 buttons for monitor function 2023-01-20 09:29:08 -08:00
cypress-sf.c Input: Switch i2c drivers back to use .probe() 2023-05-17 09:59:11 -07:00
dlink-dir685-touchkeys.c Input: Switch i2c drivers back to use .probe() 2023-05-17 09:59:11 -07:00
ep93xx_keypad.c Input: ep39xx-keypad - switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr() 2022-12-07 13:26:52 -08:00
goldfish_events.c Input: goldfish_events - replace zero-length array with flexible-array member 2020-02-13 17:09:47 -08:00
gpio_keys.c Input: gpio-keys - convert to dev_err_probe() 2023-07-17 10:03:08 -07:00
gpio_keys_polled.c Input: gpio_keys_polled - suppress deferred probe error for gpio 2024-03-26 18:19:15 -04:00
hil_kbd.c Input: hil_kbd - fix error return code in hil_dev_connect() 2021-05-24 20:57:04 -07:00
hilkbd.c parisc: Make struct parisc_driver::remove() return void 2021-08-30 10:18:25 +02:00
hpps2atkbd.h Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
imx_keypad.c Input: imx_keypad - add missing linux/input.h include 2022-09-26 08:15:10 -07:00
imx_sc_key.c Input: imx_sc_key - use devm_add_action_or_reset() to handle all cleanups 2020-05-13 10:34:58 -07:00
ipaq-micro-keys.c Input: ipaq-micro-keys - add error handling for devm_kmemdup 2024-01-01 12:42:36 +00:00
iqs62x-keys.c Input: iqs62x-keys - suppress duplicated error message in .remove() 2023-03-19 21:34:24 -07:00
jornada680_kbd.c Input: jornada680_kbd - switch to using polled mode of input devices 2019-10-29 17:13:44 -07:00
jornada720_kbd.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
Kconfig Input updates for 6.3 merge window: 2023-02-25 15:01:32 -08:00
lkkbd.c input: drop empty comment blocks 2022-09-29 16:25:42 -07:00
lm8323.c Input: lm8323 - convert to use devm_* api 2023-07-28 18:04:00 -07:00
lm8333.c Input: lm8333 - convert to use devm_* api 2023-07-20 16:52:47 -07:00
locomokbd.c treewide: Convert del_timer*() to timer_shutdown*() 2022-12-25 13:38:09 -08:00
lpc32xx-keys.c Input: lpc32xx-keys - convert to devm_platform_ioremap_resource() 2023-07-10 17:44:25 -07:00
Makefile input: remove pxa930_rotary keyboard driver 2023-02-01 17:23:38 +01:00
maple_keyb.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 64 2019-05-24 17:36:46 +02:00
matrix_keypad.c Input: Use of_property_read_bool() for boolean properties 2023-03-17 04:17:29 -07:00
max7359_keypad.c Input: Switch i2c drivers back to use .probe() 2023-05-17 09:59:11 -07:00
mcs_touchkey.c Input: mcs-touchkey - fix uninitialized use of error in mcs_touchkey_probe() 2023-07-25 09:51:13 -07:00
mpr121_touchkey.c Input: Switch i2c drivers back to use .probe() 2023-05-17 09:59:11 -07:00
mt6779-keypad.c Input: mt6779-keypad - add missing linux/input.h include 2022-09-26 08:15:03 -07:00
mtk-pmic-keys.c Input: mtk-pmic-keys - fix possible null pointer dereference 2025-05-18 08:24:06 +02:00
newtonkbd.c input: drop empty comment blocks 2022-09-29 16:25:42 -07:00
nomadik-ske-keypad.c Input: nomadik-ske-keypad - convert to use devm_* api 2023-07-10 17:44:29 -07:00
nspire-keypad.c Input: nspire-keypad - use devm_platform_get_and_ioremap_resource() 2023-07-10 17:44:26 -07:00
omap-keypad.c treewide: Convert del_timer*() to timer_shutdown*() 2022-12-25 13:38:09 -08:00
omap4-keypad.c Input: omap4-keyad - convert to devm_platform_ioremap_resource() 2023-07-10 17:44:27 -07:00
opencores-kbd.c Input: opencores-kbd - convert to devm_platform_ioremap_resource() 2023-07-10 17:44:27 -07:00
pinephone-keyboard.c Input: pinephone-keyboard - use devm_regulator_get_enable() 2023-07-07 17:03:26 -07:00
pmic8xxx-keypad.c Input: pmic8xxx-keypad - switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr() 2022-12-07 13:27:55 -08:00
pxa27x_keypad.c Input: pxa27x_keypad - convert to devm_platform_ioremap_resource() 2023-07-10 17:44:28 -07:00
qt1050.c Input: qt1050 - handle CHIP_ID reading error 2024-08-03 08:53:58 +02:00
qt1070.c Input: qt1070 - convert to use devm_* api 2023-07-20 16:52:49 -07:00
qt2160.c Input: qt2160 - convert to use devm_* api 2023-07-28 18:03:11 -07:00
samsung-keypad.c Input: Use of_property_read_bool() for boolean properties 2023-03-17 04:17:29 -07:00
sh_keysc.c Input: sh-keysc - switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr() 2022-12-07 13:28:04 -08:00
snvs_pwrkey.c Input: snvs_pwrkey - fix SNVS_HPVIDR1 register address 2022-09-27 07:18:30 -07:00
spear-keyboard.c Input: spear-keyboard - use devm_platform_get_and_ioremap_resource() 2023-01-29 20:36:38 -08:00
st-keyscan.c Input: st-keyscan - drop of_match_ptr for ID table 2023-03-17 04:17:32 -07:00
stmpe-keypad.c Input: stmpe-keypad - add missing of.h include 2022-10-28 11:56:17 -07:00
stowaway.c input: drop empty comment blocks 2022-09-29 16:25:42 -07:00
sun4i-lradc-keys.c Input: Explicitly include correct DT includes 2023-07-17 10:03:07 -07:00
sunkbd.c input: drop empty comment blocks 2022-09-29 16:25:42 -07:00
tc3589x-keypad.c Input: tc3589x - switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr() 2022-12-07 13:28:10 -08:00
tca6416-keypad.c Input: tca6416-keypad - switch to using input core's polling features 2023-07-28 18:05:42 -07:00
tca8418_keypad.c Input: Switch i2c drivers back to use .probe() 2023-05-17 09:59:11 -07:00
tegra-kbc.c Input: tegra-kbc - use devm_platform_ioremap_resource 2023-07-10 12:00:03 -07:00
tm2-touchkey.c Input: Explicitly include correct DT includes 2023-07-17 10:03:07 -07:00
twl4030_keypad.c Input: twl4030_keypad - fix handling of platform_get_irq() error 2020-09-16 10:42:15 -07:00
xtkbd.c input: drop empty comment blocks 2022-09-29 16:25:42 -07:00