]> git.dujemihanovic.xyz Git - u-boot.git/commit
input: button_kbd: gracefully handle buttons that fail probe
authorCaleb Connolly <caleb.connolly@linaro.org>
Thu, 11 Apr 2024 17:52:37 +0000 (19:52 +0200)
committerTom Rini <trini@konsulko.com>
Thu, 18 Apr 2024 22:37:10 +0000 (16:37 -0600)
commit024c95392d5ab5414e455e6f92e06dd063296d77
tree366aa0fa6bce92df062eade122b83d5f82262fd5
parenta1802b3ce160026e7214cf7c56c529bc6500a898
input: button_kbd: gracefully handle buttons that fail probe

If a button device fails to probe, it will still be added to the uclass
device list, and therefore will still be iterated over in
button_read_keys() resulting in a UAF on the buttons private data.

Resolve this by unbinding button devices that aren't active after
probing, and print a warning so it's clear that the button is broken.

Fixes: e8779962898e ("dm: input: add button_kbd driver")
Signed-off-by: Caleb Connolly <caleb.connolly@linaro.org>
drivers/input/button_kbd.c