HID: u2fzero: properly handle timeouts in usb_submit_urb
stable inclusion from stable-5.10.80 commit 4310970d0b4db03e769dcfc8e3f756ce4b789a01 bugzilla: 185821 https://gitee.com/openeuler/kernel/issues/I4L7CG Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=4310970d0b4db03e769dcfc8e3f756ce4b789a01 -------------------------------- [ Upstream commit 43775e62 ] The wait_for_completion_timeout function returns 0 if timed out or a positive value if completed. Hence, "less than zero" comparison always misses timeouts and doesn't kill the URB as it should, leading to re-sending it while it is active. Fixes: 42337b9d ("HID: add driver for U2F Zero built-in LED and RNG") Signed-off-by:Andrej Shadura <andrew.shadura@collabora.co.uk> Signed-off-by:
Jiri Kosina <jkosina@suse.cz> Signed-off-by:
Sasha Levin <sashal@kernel.org> Signed-off-by:
Chen Jun <chenjun102@huawei.com> Reviewed-by:
Weilong Chen <chenweilong@huawei.com> Acked-by:
Weilong Chen <chenweilong@huawei.com> Signed-off-by:
Chen Jun <chenjun102@huawei.com> Signed-off-by:
Zheng Zengkai <zhengzengkai@huawei.com>
Loading
Please sign in to comment