mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2026-07-08 18:13:59 +02:00
HID: playstation: Add missing check for input_ff_create_memless
[ Upstream commite6807641ac] 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> Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
committed by
Sasha Levin
parent
a278b77e2f
commit
987dee1486
@@ -508,7 +508,9 @@ static struct input_dev *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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user