]> rtime.felk.cvut.cz Git - zynq/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)
committerMichal Simek <michal.simek@xilinx.com>
Wed, 9 Jan 2019 08:16:07 +0000 (09:16 +0100)
commit41cdfea51e043232063c11a096cf4ca23d26239f
tree3e41b6212145f9c9c1a02e8107617fe8daa22b8f
parente03af1c718b703ff6f4d9c07c3e1fc1484c3e460
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