Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

HID: pidff: fix error return code in hid_pidff_init()

Fix to return a negative error code from the error handling
case instead of 0, as done elsewhere in this function.

Fixes: 224ee88fe395 ("Input: add force feedback driver for PID devices")
Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Zhen Lei <thunder.leizhen@huawei.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>

authored by

Zhen Lei and committed by
Jiri Kosina
3dd653c0 81c8bf91

+1
+1
drivers/hid/usbhid/hid-pidff.c
··· 1292 1292 1293 1293 if (pidff->pool[PID_DEVICE_MANAGED_POOL].value && 1294 1294 pidff->pool[PID_DEVICE_MANAGED_POOL].value[0] == 0) { 1295 + error = -EPERM; 1295 1296 hid_notice(hid, 1296 1297 "device does not support device managed pool\n"); 1297 1298 goto fail;