Skip to content
  • Willy Tarreau's avatar
    auxdisplay: charlcd: properly restore atomic counter on error path · 93dc1774
    Willy Tarreau authored
    Commit f4757af8 ("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: f4757af8
    
     # 3.19-rc1
    Cc: stable@vger.kernel.org
    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: default avatarWilly Tarreau <w@1wt.eu>
    Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
    93dc1774