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)
commit7c04ecf01912a9216a543f81f9e50a107e3708a0
tree18ad17e417dff4a739104897375be9d0c775ac79
parentc20b1297db85633467d759178d63f7bb251258cb
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: 6d9560f124e9 ("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