From: Jakub Kicinski Date: Mon, 16 Mar 2015 23:28:46 +0000 (+0100) Subject: sc16is7xx: remove ports on probe error path X-Git-Url: http://drtracing.org/?a=commitdiff_plain;h=11b03ea0c1ef1cd2df3e7ea0437a13e2dfb65f60;p=deliverable%2Flinux.git 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 Signed-off-by: Jon Ringle Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/tty/serial/sc16is7xx.c b/drivers/tty/serial/sc16is7xx.c index df9a384dfbda..11bb44039a57 100644 --- a/drivers/tty/serial/sc16is7xx.c +++ b/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