瀏覽代碼

sc16is7xx: remove ports on probe error path

If ports are not explicitly removed on the error path
the device will not get properly unregistered leaving
/dev/ttySC* nodes in the filesystem.

Signed-off-by: Jakub Kicinski <kubakici@wp.pl>
Signed-off-by: Jon Ringle <jringle@gridpoint.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Jakub Kicinski 10 年之前
父節點
當前提交
11b03ea0c1
共有 1 個文件被更改,包括 3 次插入0 次删除
  1. 3 0
      drivers/tty/serial/sc16is7xx.c

+ 3 - 0
drivers/tty/serial/sc16is7xx.c

@@ -1120,6 +1120,9 @@ static int sc16is7xx_probe(struct device *dev,
 	if (!ret)
 		return 0;
 
+	for (i = 0; i < s->uart.nr; i++)
+		uart_remove_one_port(&s->uart, &s->p[i].port);
+
 	mutex_destroy(&s->mutex);
 
 #ifdef CONFIG_GPIOLIB