linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] HID: usbhid: hid-pidff: Fix missing error code in hid_pidff_init()
@ 2021-06-01 11:05 Jiapeng Chong
  2021-06-24 12:05 ` Jiri Kosina
  0 siblings, 1 reply; 2+ messages in thread
From: Jiapeng Chong @ 2021-06-01 11:05 UTC (permalink / raw)
  To: jikos
  Cc: benjamin.tissoires, linux-usb, linux-input, linux-kernel, Jiapeng Chong

The error code is missing in this code scenario, add the error code
'-EINVAL' to the return value 'error'.

Eliminate the follow smatch warning:

drivers/hid/usbhid/hid-pidff.c:1297 hid_pidff_init() warn: missing error
code 'error'.

Reported-by: Abaci Robot <abaci@linux.alibaba.com>
Signed-off-by: Jiapeng Chong <jiapeng.chong@linux.alibaba.com>
---
 drivers/hid/usbhid/hid-pidff.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/hid/usbhid/hid-pidff.c b/drivers/hid/usbhid/hid-pidff.c
index ea126c5..731b49e 100644
--- a/drivers/hid/usbhid/hid-pidff.c
+++ b/drivers/hid/usbhid/hid-pidff.c
@@ -1294,6 +1294,7 @@ int hid_pidff_init(struct hid_device *hid)
 	    pidff->pool[PID_DEVICE_MANAGED_POOL].value[0] == 0) {
 		hid_notice(hid,
 			   "device does not support device managed pool\n");
+		error = -EINVAL;
 		goto fail;
 	}
 
-- 
1.8.3.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] HID: usbhid: hid-pidff: Fix missing error code in hid_pidff_init()
  2021-06-01 11:05 [PATCH] HID: usbhid: hid-pidff: Fix missing error code in hid_pidff_init() Jiapeng Chong
@ 2021-06-24 12:05 ` Jiri Kosina
  0 siblings, 0 replies; 2+ messages in thread
From: Jiri Kosina @ 2021-06-24 12:05 UTC (permalink / raw)
  To: Jiapeng Chong; +Cc: benjamin.tissoires, linux-usb, linux-input, linux-kernel

On Tue, 1 Jun 2021, Jiapeng Chong wrote:

> The error code is missing in this code scenario, add the error code
> '-EINVAL' to the return value 'error'.
> 
> Eliminate the follow smatch warning:
> 
> drivers/hid/usbhid/hid-pidff.c:1297 hid_pidff_init() warn: missing error
> code 'error'.
> 
> Reported-by: Abaci Robot <abaci@linux.alibaba.com>
> Signed-off-by: Jiapeng Chong <jiapeng.chong@linux.alibaba.com>

This has already been fixed in hid.git via 3dd653c077efd.

Thanks,

-- 
Jiri Kosina
SUSE Labs


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-06-24 12:05 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-01 11:05 [PATCH] HID: usbhid: hid-pidff: Fix missing error code in hid_pidff_init() Jiapeng Chong
2021-06-24 12:05 ` Jiri Kosina

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).