]> git.ipfire.org Git - thirdparty/linux.git/commit
Input: psxpad-spi - add a check for the return value of spi_setup()
authorHaotian Zhang <vulab@iscas.ac.cn>
Mon, 29 Sep 2025 05:01:10 +0000 (22:01 -0700)
committerDmitry Torokhov <dmitry.torokhov@gmail.com>
Mon, 29 Sep 2025 05:02:00 +0000 (22:02 -0700)
commitdb74430a4218f282d16e58a38337275ad3f9f517
tree132e0cfc86de81977711f1cc9aca18edaaffb676
parentd3366a04770eea807f2826cbdb96934dd8c9bf79
Input: psxpad-spi - add a check for the return value of spi_setup()

The probe function in the psxpad-spi driver calls spi_setup()
but fails to check its return value. If the SPI bus setup fails,
the driver will still load successfully, resulting in potential
error in later I/O operations.

Add a check for the return value of spi_setup() and return
an error on failure.

Fixes: 8be193c7b1f4 ("Input: add support for PlayStation 1/2 joypads connected via SPI")
Signed-off-by: Haotian Zhang <vulab@iscas.ac.cn>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
drivers/input/joystick/psxpad-spi.c