summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorChen Ni <nichen@iscas.ac.cn>2024-05-15 06:30:51 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2024-06-21 15:40:15 +0300
commite8a9f5b329f74835e95bf3588fe2e5abebcca8dc (patch)
tree1279f5521902a50b45710dc9cd9edd44146d461e /drivers
parent328a3ec61a6235424fd6e9cf2b79e7035d172091 (diff)
downloadlinux-e8a9f5b329f74835e95bf3588fe2e5abebcca8dc.tar.xz
HID: nvidia-shield: Add missing check for input_ff_create_memless
[ Upstream commit 0a3f9f7fc59feb8a91a2793b8b60977895c72365 ] 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> Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/hid/hid-nvidia-shield.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/hid/hid-nvidia-shield.c b/drivers/hid/hid-nvidia-shield.c
index 58b15750dbb0..ff9078ad1961 100644
--- a/drivers/hid/hid-nvidia-shield.c
+++ b/drivers/hid/hid-nvidia-shield.c
@@ -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)