Skip to content

Commit 0a3f9f7

Browse files
Chen NiJiri Kosina
authored andcommitted
HID: nvidia-shield: Add missing check for input_ff_create_memless
Add check for the return value of input_ff_create_memless() and return the error if it fails in order to catch the error. Fixes: 0930856 ("HID: nvidia-shield: Initial driver implementation with Thunderstrike support") Signed-off-by: Chen Ni <nichen@iscas.ac.cn> Reviewed-by: Rahul Rameshbabu <rrameshbabu@nvidia.com> Signed-off-by: Jiri Kosina <jkosina@suse.com>
1 parent 2360497 commit 0a3f9f7

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

drivers/hid/hid-nvidia-shield.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -283,7 +283,9 @@ static struct input_dev *shield_haptics_create(
283283
return haptics;
284284

285285
input_set_capability(haptics, EV_FF, FF_RUMBLE);
286-
input_ff_create_memless(haptics, NULL, play_effect);
286+
ret = input_ff_create_memless(haptics, NULL, play_effect);
287+
if (ret)
288+
goto err;
287289

288290
ret = input_register_device(haptics);
289291
if (ret)

0 commit comments

Comments
 (0)