Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

8250: Fix capabilities when changing the port type

When changing the port type, the capabilities flags should be changed
also, otherwise the capabilities will not correspond to the port type,
which make set_sleep() crash on rmmod.

This patch just assign the correct capabilites when the port changes.

Signed-off-by: Breno Leitao <leitao@linux.vnet.ibm.com>
CC: Michael Reed <mreed@linux.vnet.ibm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

authored by

leitao@linux.vnet.ibm.com and committed by
Greg Kroah-Hartman
cb01ece3 1798ca13

+1
+1
drivers/tty/serial/8250.c
··· 3318 3318 uart->port.flags &= ~UPF_BOOT_AUTOCONF; 3319 3319 uart->port.type = PORT_UNKNOWN; 3320 3320 uart->port.dev = &serial8250_isa_devs->dev; 3321 + uart->capabilities = uart_config[uart->port.type].flags; 3321 3322 uart_add_one_port(&serial8250_reg, &uart->port); 3322 3323 } else { 3323 3324 uart->port.dev = NULL;