staging: most: destroy cdev when channel gets disconnected
authorAndrey Shvetsov <andrey.shvetsov@k2l.de>
Fri, 7 Apr 2017 13:38:37 +0000 (15:38 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 8 Apr 2017 10:41:39 +0000 (12:41 +0200)
commit2c4aaa1fffe8d01c621e2515cd5f290227949e71
tree95433779341c40c206ff0e5355233c3af230075d
parent5f788625cd4c5d4062fc3f95308de74d65d7a314
staging: most: destroy cdev when channel gets disconnected

When a channel is being removed while an application holds the
corresponding character device, this device is going to be destroyed only
after the application closes the file descriptor and releases character
device. In case the channel appears again before the application closes the
file descriptor it holds, the channel cannot be linked.

This patch changes the described behavior and destroys the character
device at the time the channel get disconnected from the AIM.

Signed-off-by: Andrey Shvetsov <andrey.shvetsov@k2l.de>
Signed-off-by: Christian Gromm <christian.gromm@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/most/aim-cdev/cdev.c