Skip to contentSkip to conversation

serial/uartlite: Only enable port if request_port succeeded

PATCH New Peter Korsgaard 1 participant 1 message Dec 22, 2006 TTY layer and serial drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 serial/uartlite: Only enable port if request_port succeeded

The uartlite driver would happily enable the port even if request_port failed causing havoc. This patch fixes it.

drivers/serial/uartlite.c +2 -2
diff -urpN linux-2.6.20-rc1/drivers/serial/uartlite.c linux-2.6.20-rc1.new/drivers/serial/uartlite.c
@@ -278,8 +278,8 @@ static int ulite_request_port(struct uar
 
 static void ulite_config_port(struct uart_port *port, int flags)
 {
-	ulite_request_port(port);
-	port->type = PORT_UARTLITE;
+	if (!ulite_request_port(port))
+		port->type = PORT_UARTLITE;
 }
 
 static int ulite_verify_port(struct uart_port *port, struct serial_struct *ser)
Signature · 1 line
Bye, Peter Korsgaard