[Devel] [PATCH] tty: call device_destroy_namespace only for containerized drivers
Andrew Vagin
avagin at openvz.org
Mon Jul 6 05:02:54 PDT 2015
Containerized drivers save ve in drvdata, but other drivers can use
drvdata for own needs. For example, uart_add_one_port calls
tty_port_register_device_attr with non-zero drvdata
https://jira.sw.ru/browse/PSBM-33971
Cc: Cyrill Gorcunov <gorcunov at openvz.org>
Signed-off-by: Andrew Vagin <avagin at openvz.org>
---
drivers/tty/tty_io.c | 13 +++++++------
1 files changed, 7 insertions(+), 6 deletions(-)
diff --git a/drivers/tty/tty_io.c b/drivers/tty/tty_io.c
index 13f2430..1da7df3 100644
--- a/drivers/tty/tty_io.c
+++ b/drivers/tty/tty_io.c
@@ -3257,13 +3257,14 @@ EXPORT_SYMBOL_GPL(tty_register_device_attr);
void tty_unregister_device(struct tty_driver *driver, unsigned index)
{
#ifdef CONFIG_VE
- device_destroy_namespace(tty_class,
- MKDEV(driver->major, driver->minor_start) + index,
- driver->ve);
-#else
- device_destroy(tty_class,
- MKDEV(driver->major, driver->minor_start) + index);
+ if (driver->flags & TTY_DRIVER_CONTAINERIZED) {
+ device_destroy_namespace(tty_class,
+ MKDEV(driver->major, driver->minor_start) + index,
+ driver->ve);
+ } else
#endif
+ device_destroy(tty_class,
+ MKDEV(driver->major, driver->minor_start) + index);
if (!(driver->flags & TTY_DRIVER_DYNAMIC_ALLOC))
tty_cdev_del(driver, &driver->cdevs[index]);
}
--
1.7.1
More information about the Devel
mailing list