|
@@ -1110,7 +1110,7 @@ static struct uart_port *cdns_uart_get_port(int id)
|
|
struct uart_port *port;
|
|
struct uart_port *port;
|
|
|
|
|
|
/* Try the given port id if failed use default method */
|
|
/* Try the given port id if failed use default method */
|
|
- if (cdns_uart_port[id].mapbase != 0) {
|
|
|
|
|
|
+ if (id < CDNS_UART_NR_PORTS && cdns_uart_port[id].mapbase != 0) {
|
|
/* Find the next unused port */
|
|
/* Find the next unused port */
|
|
for (id = 0; id < CDNS_UART_NR_PORTS; id++)
|
|
for (id = 0; id < CDNS_UART_NR_PORTS; id++)
|
|
if (cdns_uart_port[id].mapbase == 0)
|
|
if (cdns_uart_port[id].mapbase == 0)
|