diff options
author | Johan Hovold <johan@kernel.org> | 2017-04-26 13:24:21 +0300 |
---|---|---|
committer | Ben Hutchings <ben@decadent.org.uk> | 2017-09-15 20:29:45 +0300 |
commit | 1cfd13c09c53dbfacc57df895a50c34fe77ae8e9 (patch) | |
tree | 7842ecf5db9054138ed669efb1297e70b7adbbb1 /drivers/tty | |
parent | 3c75067fc2579715bcc92525a49da9836ebfe26e (diff) | |
download | linux-1cfd13c09c53dbfacc57df895a50c34fe77ae8e9.tar.xz |
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: 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: Ben Hutchings <ben@decadent.org.uk>
Diffstat (limited to 'drivers/tty')
-rw-r--r-- | drivers/tty/serial/ifx6x60.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/tty/serial/ifx6x60.c b/drivers/tty/serial/ifx6x60.c index 7d858a74ee38..fe958f415e85 100644 --- a/drivers/tty/serial/ifx6x60.c +++ b/drivers/tty/serial/ifx6x60.c @@ -1379,9 +1379,9 @@ static struct spi_driver ifx_spi_driver = { static void __exit ifx_spi_exit(void) { /* unregister */ + spi_unregister_driver(&ifx_spi_driver); tty_unregister_driver(tty_drv); put_tty_driver(tty_drv); - spi_unregister_driver(&ifx_spi_driver); unregister_reboot_notifier(&ifx_modem_reboot_notifier_block); } |