]> git.baikalelectronics.ru Git - kernel.git/commit
HID: hiddev cleanup -- handle all error conditions properly
authorOliver Neukum <oliver@neukum.org>
Tue, 16 Dec 2008 09:55:15 +0000 (10:55 +0100)
committerJiri Kosina <jkosina@suse.cz>
Sun, 4 Jan 2009 00:00:53 +0000 (01:00 +0100)
commitd13db3e2c96e0d63c6c8b7edf9459520f045650c
tree4f6c083dcf3585e28b7540d7358e3f89bdbc9b0c
parentcb33d00bdce4f42e693c20f170d9064bb26c2ac7
HID: hiddev cleanup -- handle all error conditions properly

This is a cleanup of hiddev and fixes the following issues:

- thread safety by locking in read & ioctl, introducing a per device mutex
- race between ioctl and disconnect, introducing a flag and locking
  in form of a per low level device mutex
- race between open and other methods, making sure only successfully
  opened devices are put on the list, changing order of events
- range checking both upper and lower limits of the minor range
- make sure further calls to open fail for unplugged devices even if
  the device still has opened files
- error checking for low level open
- possible loss of wakeup events, using standard waiting macros
- race in initialisation by moving registration after full initialisation

Signed-off-by: Oliver Neukum <oneukum@suse.de>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
drivers/hid/usbhid/hiddev.c