[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20240515033051.2693390-1-nichen@iscas.ac.cn>
Date: Wed, 15 May 2024 11:30:51 +0800
From: Chen Ni <nichen@...as.ac.cn>
To: rrameshbabu@...dia.com,
jikos@...nel.org,
bentiss@...nel.org
Cc: linux-input@...r.kernel.org,
linux-kernel@...r.kernel.org,
Chen Ni <nichen@...as.ac.cn>
Subject: [PATCH] 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.
Signed-off-by: Chen Ni <nichen@...as.ac.cn>
---
drivers/hid/hid-nvidia-shield.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
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)
--
2.25.1
Powered by blists - more mailing lists