Commit d836691b authored by David Woodhouse's avatar David Woodhouse

Complain about setting custom speed or divisor on serial ports.

parent c84c2b62
...@@ -826,8 +826,17 @@ uart_set_info(struct uart_info *info, struct serial_struct *newinfo) ...@@ -826,8 +826,17 @@ uart_set_info(struct uart_info *info, struct serial_struct *newinfo)
goto exit; goto exit;
if (info->flags & UIF_INITIALIZED) { if (info->flags & UIF_INITIALIZED) {
if (((old_flags ^ port->flags) & UPF_SPD_MASK) || if (((old_flags ^ port->flags) & UPF_SPD_MASK) ||
old_custom_divisor != port->custom_divisor) old_custom_divisor != port->custom_divisor) {
/* If they're setting up a custom divisor or speed,
* instead of clearing it, then bitch about it. No
* need to rate-limit; it's CAP_SYS_ADMIN only. */
if (port->flags & UPF_SPD_MASK) {
printk(KERN_NOTICE "%s sets custom speed on %s%d. This is deprecated.\n",
current->comm, info->tty->driver.name,
info->port->line);
}
uart_change_speed(info, NULL); uart_change_speed(info, NULL);
}
} else } else
retval = uart_startup(info, 1); retval = uart_startup(info, 1);
exit: exit:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment