]> asedeno.scripts.mit.edu Git - linux.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)
commit2088cfd882d0403609bdf426e9b24372fe1b8337
tree18ad17e417dff4a739104897375be9d0c775ac79
parent33a1a7be198657c8ca26ad406c4d2a89b7162bcc
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: ae1cca3fa347 ("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