]> git.baikalelectronics.ru Git - kernel.git/commit
serial: uartps: Do not allow use aliases >= MAX_UART_INSTANCES
authorMichal Simek <michal.simek@xilinx.com>
Mon, 8 Oct 2018 12:17:19 +0000 (14:17 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 11 Oct 2018 17:59:29 +0000 (19:59 +0200)
commitd912a6d90faacb65ed3d10d3dee3d1c1a066a5d9
tree18ad17e417dff4a739104897375be9d0c775ac79
parent07764627ab8bad93c35ac2d79035a01ce73d6029
serial: uartps: Do not allow use aliases >= MAX_UART_INSTANCES

Aliases >= MAX_UART_INSTANCES is no problem to find out and use but in
error path is necessary skip clearing bits in bitmap to ensure that only
bits in allocated bitmap are handled and nothing beyond that.
Without this patch when for example serial90 alias is used then in error
patch bit 90 is clear in 32bit wide bitmap.

Fixes: 5257e56d0b1b ("serial: uartps: Change uart ID port allocation")
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/tty/serial/xilinx_uartps.c