]> git.hungrycats.org Git - linux/commit
misc: panel: properly restore atomic counter on error path
authorWilly Tarreau <w@1wt.eu>
Thu, 7 Sep 2017 09:56:40 +0000 (11:56 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 18 Nov 2017 10:22:25 +0000 (11:22 +0100)
commite81b96cab11f57506ade92656a76db8bbe7b6673
tree7e2411f0a8f8b2f0d4c37241b3453041f81cf860
parentb2dbcb7c969dcb6a2dcbe901a4a9070bb30e4788
misc: panel: properly restore atomic counter on error path

commit 93dc1774d2a4c7a298d5cdf78cc8acdcb7b1428d upstream.

Commit f4757af ("staging: panel: Fix single-open policy race condition")
introduced in 3.19-rc1 attempted to fix a race condition on the open, but
failed to properly do it and used to exit without restoring the semaphore.

This results in -EBUSY being returned after the first open error until
the module is reloaded or the system restarted (ie: consecutive to a
dual open resulting in -EBUSY or to a permission error).

Fixes: f4757af85 # 3.19-rc1
Cc: Mariusz Gorski <marius.gorski@gmail.com>
Signed-off-by: Willy Tarreau <w@1wt.eu>
[wt: driver is in misc/panel in 4.9]
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/misc/panel.c