]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/commit
auxdisplay: charlcd: properly restore atomic counter on error path
authorWilly Tarreau <w@1wt.eu>
Thu, 7 Sep 2017 13:37:30 +0000 (15:37 +0200)
committerSeth Forshee <seth.forshee@canonical.com>
Thu, 19 Oct 2017 14:49:04 +0000 (09:49 -0500)
commitafc5794bc51c8a7c83f90c62127a059fb00038a3
tree05debd391b4a06dfbbf3d8bdfb5b115cf530d986
parentc8bf89f1705233b5a84fa8c286d7c45a5411f591
auxdisplay: charlcd: properly restore atomic counter on error path

BugLink: http://bugs.launchpad.net/bugs/1723145
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).

[ Note for stable maintainers: the code moved from drivers/misc/panel.c
  to drivers/auxdisplay/{charlcd,panel}.c during 4.12. The patch easily
  applies there (modulo the renamed atomic counter) but I can provide a
  tested backport if desired. ]

Fixes: f4757af85 # 3.19-rc1
Cc: Mariusz Gorski <marius.gorski@gmail.com>
Cc: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: Miguel Ojeda Sandonis <miguel.ojeda.sandonis@gmail.com>
Signed-off-by: Willy Tarreau <w@1wt.eu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
drivers/auxdisplay/charlcd.c
drivers/auxdisplay/panel.c