]> git.baikalelectronics.ru Git - kernel.git/commit
HID: logitech-dj: Fix error handling in logi_dj_recv_switch_to_dj_mode()
authorNikita Zhandarovich <n.zhandarovich@fintech.ru>
Tue, 13 Jun 2023 10:16:35 +0000 (03:16 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 13 Sep 2023 07:42:57 +0000 (09:42 +0200)
commit6e59609541514d2ed3472f5bc999c55bdb6144ee
treeb9f4e38acd7e1f68d30ade507f47170b86a7daba
parentcf38960386f3cc4abf395e556af915e4babcafd2
HID: logitech-dj: Fix error handling in logi_dj_recv_switch_to_dj_mode()

[ Upstream commit 6f20d3261265885f6a6be4cda49d7019728760e0 ]

Presently, if a call to logi_dj_recv_send_report() fails, we do
not learn about the error until after sending short
HID_OUTPUT_REPORT with hid_hw_raw_request().
To handle this somewhat unlikely issue, return on error in
logi_dj_recv_send_report() (minding ugly sleep workaround) and
take into account the result of hid_hw_raw_request().

Found by Linux Verification Center (linuxtesting.org) with static
analysis tool SVACE.

Fixes: 6a9ddc897883 ("HID: logitech-dj: enable notifications on connect/disconnect")
Signed-off-by: Nikita Zhandarovich <n.zhandarovich@fintech.ru>
Link: https://lore.kernel.org/r/20230613101635.77820-1-n.zhandarovich@fintech.ru
Signed-off-by: Benjamin Tissoires <bentiss@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/hid/hid-logitech-dj.c