serial: ifx6x60: fix use-after-free on module unload
authorJohan Hovold <johan@kernel.org>
Wed, 26 Apr 2017 10:24:21 +0000 (12:24 +0200)
committerWilly Tarreau <w@1wt.eu>
Wed, 1 Nov 2017 21:12:43 +0000 (22:12 +0100)
commite044ff5c05d3d24f1f0d70122b535d8390010b05
treeca0e7a61e89ce77de66de2bd559fab41a60a2090
parent6c176369e70376d26e2de758401176a8342d7af5
serial: ifx6x60: fix use-after-free on module unload

commit 1e948479b3d63e3ac0ecca13cbf4921c7d17c168 upstream.

Make sure to deregister the SPI driver before releasing the tty driver
to avoid use-after-free in the SPI remove callback where the tty
devices are deregistered.

Fixes: 72d4724ea54c ("serial: ifx6x60: Add modem power off function in the platform reboot process")
Cc: stable <stable@vger.kernel.org> # 3.8
Cc: Jun Chen <jun.d.chen@intel.com>
Signed-off-by: Johan Hovold <johan@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Willy Tarreau <w@1wt.eu>
drivers/tty/serial/ifx6x60.c