From: Zhen Lei Date: Sat, 8 May 2021 02:47:37 +0000 (+0800) Subject: HID: pidff: fix error return code in hid_pidff_init() X-Git-Tag: v5.13-rc5~21^2~9 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=3dd653c077efda8152f4dd395359617d577a54cd;p=thirdparty%2Fkernel%2Flinux.git 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 Signed-off-by: Zhen Lei Signed-off-by: Jiri Kosina --- diff --git a/drivers/hid/usbhid/hid-pidff.c b/drivers/hid/usbhid/hid-pidff.c index ea126c50acc3b..3b4ee21cd8111 100644 --- a/drivers/hid/usbhid/hid-pidff.c +++ b/drivers/hid/usbhid/hid-pidff.c @@ -1292,6 +1292,7 @@ int hid_pidff_init(struct hid_device *hid) if (pidff->pool[PID_DEVICE_MANAGED_POOL].value && pidff->pool[PID_DEVICE_MANAGED_POOL].value[0] == 0) { + error = -EPERM; hid_notice(hid, "device does not support device managed pool\n"); goto fail;