summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHaotian Zhang <vulab@iscas.ac.cn>2025-11-17 16:28:08 +0800
committerJiri Kosina <jkosina@suse.com>2026-01-10 10:00:23 +0100
commite6807641ac94e832988655a1c0e60ccc806b76dc (patch)
tree2f55694f9cad6c84c4ebefc2bf3b99320eaa52b7
parent7273acfd0aef106093a8ffa3b4973eb70e5a3799 (diff)
HID: playstation: Add missing check for input_ff_create_memless
The ps_gamepad_create() function calls input_ff_create_memless() without verifying its return value, which can lead to incorrect behavior or potential crashes when FF effects are triggered. Add a check for the return value of input_ff_create_memless(). Fixes: 51151098d7ab ("HID: playstation: add DualSense classic rumble support.") Signed-off-by: Haotian Zhang <vulab@iscas.ac.cn> Signed-off-by: Jiri Kosina <jkosina@suse.com>
-rw-r--r--drivers/hid/hid-playstation.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/hid/hid-playstation.c b/drivers/hid/hid-playstation.c
index e4dfcf26b04e..2ec6d4445e84 100644
--- a/drivers/hid/hid-playstation.c
+++ b/drivers/hid/hid-playstation.c
@@ -774,7 +774,9 @@ ps_gamepad_create(struct hid_device *hdev,
#if IS_ENABLED(CONFIG_PLAYSTATION_FF)
if (play_effect) {
input_set_capability(gamepad, EV_FF, FF_RUMBLE);
- input_ff_create_memless(gamepad, NULL, play_effect);
+ ret = input_ff_create_memless(gamepad, NULL, play_effect);
+ if (ret)
+ return ERR_PTR(ret);
}
#endif