diff options
author | Johan Hovold <johan@kernel.org> | 2017-04-11 20:07:29 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2017-05-18 17:41:49 +0300 |
commit | aee5da7838787f8ed47f825dbe09e2812acdf97b (patch) | |
tree | 993f2865f8971801be62985ee3b4fa8dd729bfaa /drivers/tty/serial/efm32-uart.c | |
parent | d3ba126a226a6b6da021ebfea444a2a807cde945 (diff) | |
download | linux-aee5da7838787f8ed47f825dbe09e2812acdf97b.tar.xz |
serdev: fix tty-port client deregistration
The port client data must be set when registering the serdev controller
or client deregistration will fail (and the serdev devices are left
registered and allocated) if the port was never opened in between.
Make sure to clear the port client data on any probe errors to avoid a
use-after-free when the client is later deregistered unconditionally
(e.g. in a tty-port deregistration helper).
Also move port client operation initialisation to registration. Note
that the client ops must be restored on failed probe.
Fixes: bed35c6dfa6a ("serdev: add a tty port controller driver")
Signed-off-by: Johan Hovold <johan@kernel.org>
Reviewed-by: Rob Herring <robh@kernel.org>
Cc: stable <stable@vger.kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/tty/serial/efm32-uart.c')
0 files changed, 0 insertions, 0 deletions