]> git.baikalelectronics.ru Git - kernel.git/commit
HID: hid-debug: fix nonblocking read semantics wrt EIO/ERESTARTSYS
authorLaurent Gauthier <laurent.gauthier@soccasys.com>
Tue, 8 Sep 2020 22:11:49 +0000 (00:11 +0200)
committerJiri Kosina <jkosina@suse.cz>
Wed, 9 Sep 2020 06:47:38 +0000 (08:47 +0200)
commit1dfd62b2b573a7417bbad5a80ecaca4039d3e78a
tree3a8df5680008936a243a2c3f9a76b9e1c11083a7
parent54f559d97941b5864eb3f74e154c91b56fcceb1b
HID: hid-debug: fix nonblocking read semantics wrt EIO/ERESTARTSYS

When the file has been open in non-blocking mode, EIO or ERESTARTSYS
would never be returned even if they should (for example when device
has been unplugged, you want EIO and not EAGAIN to be returned).

Move the O_NONBLOCK check after other checks have been performed.

Based on similar to patches hidraw and hiddev by Founder Fang
<founder.fang@gmail.com> and Jiri Kosina <jkosina@suse.cz>.

Signed-off-by: Laurent Gauthier <laurent.gauthier@soccasys.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
drivers/hid/hid-debug.c