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: 51151098d7 ("HID: playstation: add DualSense classic rumble support.")
Signed-off-by: Haotian Zhang <vulab@iscas.ac.cn>
Signed-off-by: Jiri Kosina <jkosina@suse.com>
master
parent
7273acfd0a
commit
e6807641ac
|
|
@ -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
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue