Skip to content

Commit e680764

Browse files
ISCAS-VulabJiri Kosina
authored andcommitted
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: 5115109 ("HID: playstation: add DualSense classic rumble support.") Signed-off-by: Haotian Zhang <vulab@iscas.ac.cn> Signed-off-by: Jiri Kosina <jkosina@suse.com>
1 parent 7273acf commit e680764

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

drivers/hid/hid-playstation.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -774,7 +774,9 @@ ps_gamepad_create(struct hid_device *hdev,
774774
#if IS_ENABLED(CONFIG_PLAYSTATION_FF)
775775
if (play_effect) {
776776
input_set_capability(gamepad, EV_FF, FF_RUMBLE);
777-
input_ff_create_memless(gamepad, NULL, play_effect);
777+
ret = input_ff_create_memless(gamepad, NULL, play_effect);
778+
if (ret)
779+
return ERR_PTR(ret);
778780
}
779781
#endif
780782

0 commit comments

Comments
 (0)