]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
HID: nvidia-shield: Add missing check for input_ff_create_memless
authorChen Ni <nichen@iscas.ac.cn>
Wed, 15 May 2024 03:30:51 +0000 (11:30 +0800)
committerJiri Kosina <jkosina@suse.com>
Thu, 23 May 2024 12:17:22 +0000 (14:17 +0200)
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: 09308562d4af ("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>
drivers/hid/hid-nvidia-shield.c

index 58b15750dbb0ac2cb2ad333b616dc39cdea8c779..ff9078ad1961126a8d981b7e50af1dabf7ff4353 100644 (file)
@@ -283,7 +283,9 @@ static struct input_dev *shield_haptics_create(
                return haptics;
 
        input_set_capability(haptics, EV_FF, FF_RUMBLE);
-       input_ff_create_memless(haptics, NULL, play_effect);
+       ret = input_ff_create_memless(haptics, NULL, play_effect);
+       if (ret)
+               goto err;
 
        ret = input_register_device(haptics);
        if (ret)