serial: rate limit custom-speed deprecation notice
Contrary to what a comment claimed, the ASYNC_SPD flags and custom divisor can be set by a non-privileged user so rate limit the deprecation notice as was intended. Signed-off-by: Johan Hovold <johan@kernel.org> Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com> Reviewed-by: Alan Cox <alan@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:

committed by
Greg Kroah-Hartman

parent
54ebbfb160
commit
dc2f727159
@@ -954,11 +954,10 @@ static int uart_set_info(struct tty_struct *tty, struct tty_port *port,
|
|||||||
old_custom_divisor != uport->custom_divisor) {
|
old_custom_divisor != uport->custom_divisor) {
|
||||||
/*
|
/*
|
||||||
* If they're setting up a custom divisor or speed,
|
* If they're setting up a custom divisor or speed,
|
||||||
* instead of clearing it, then bitch about it. No
|
* instead of clearing it, then bitch about it.
|
||||||
* need to rate-limit; it's CAP_SYS_ADMIN only.
|
|
||||||
*/
|
*/
|
||||||
if (uport->flags & UPF_SPD_MASK) {
|
if (uport->flags & UPF_SPD_MASK) {
|
||||||
dev_notice(uport->dev,
|
dev_notice_ratelimited(uport->dev,
|
||||||
"%s sets custom speed on %s. This is deprecated.\n",
|
"%s sets custom speed on %s. This is deprecated.\n",
|
||||||
current->comm,
|
current->comm,
|
||||||
tty_name(port->tty));
|
tty_name(port->tty));
|
||||||
|
Reference in New Issue
Block a user