diff options
| author | Linmao Li <lilinmao@kylinos.cn> | 2026-07-24 18:42:06 -0700 |
|---|---|---|
| committer | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2026-07-24 18:45:30 -0700 |
| commit | 732f38c36059e68ba3b4b89c56911d777fd3185c (patch) | |
| tree | e2b4ef45e75d50fb8b76ca57d230fd7896bbee5c /drivers/input | |
| parent | 7d5c576cb1c86047b1fcb1aa9532e17fc5e46c1d (diff) | |
| download | linux-next-732f38c36059e68ba3b4b89c56911d777fd3185c.tar.gz linux-next-732f38c36059e68ba3b4b89c56911d777fd3185c.zip | |
Input: psxpad-spi - set driver data before use
psxpad_spi_suspend() retrieves the controller state with
spi_get_drvdata(), but probe never stores it, so suspend dereferences a
NULL pointer. Store it during probe.
Fixes: 8be193c7b1f4 ("Input: add support for PlayStation 1/2 joypads connected via SPI")
Signed-off-by: Linmao Li <lilinmao@kylinos.cn>
Cc: stable@vger.kernel.org
Link: https://patch.msgid.link/20260721055551.1714965-1-lilinmao@kylinos.cn
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Diffstat (limited to 'drivers/input')
| -rw-r--r-- | drivers/input/joystick/psxpad-spi.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/input/joystick/psxpad-spi.c b/drivers/input/joystick/psxpad-spi.c index f902a56d011f..aac77a2cfe46 100644 --- a/drivers/input/joystick/psxpad-spi.c +++ b/drivers/input/joystick/psxpad-spi.c @@ -373,6 +373,7 @@ static int psxpad_spi_probe(struct spi_device *spi) return err; } + spi_set_drvdata(spi, pad); pm_runtime_enable(&spi->dev); return 0; |
