counter: drop chrdev_lock
authorDavid Lechner <david@lechnology.com>
Sun, 17 Oct 2021 18:55:21 +0000 (13:55 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 19 Oct 2021 09:36:28 +0000 (11:36 +0200)
commitf5245a5fdf757f50a6c905fc16cceb1a6146ccf5
tree80a651b5444b70ceff26f93d2e97e37cd64c6f7b
parentc3ed761c9e1e4987406671b326dab48a048614ee
counter: drop chrdev_lock

This removes the chrdev_lock from the counter subsystem. This was
intended to prevent opening the chrdev more than once. However, this
doesn't work in practice since userspace can duplicate file descriptors
and pass file descriptors to other processes. Since this protection
can't be relied on, it is best to just remove it.

Suggested-by: Greg KH <gregkh@linuxfoundation.org>
Acked-by: William Breathitt Gray <vilhelm.gray@gmail.com>
Signed-off-by: David Lechner <david@lechnology.com>
Link: https://lore.kernel.org/r/20211017185521.3468640-1-david@lechnology.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/counter/counter-chrdev.c
drivers/counter/counter-sysfs.c
include/linux/counter.h