Re: [PATCH] serial: 8250: Check for valid console index

From: Andy Shevchenko
Date: Thu Oct 05 2023 - 10:28:03 EST


On Wed, Oct 04, 2023 at 11:55:10AM +0300, Tony Lindgren wrote:
> Let's not allow negative numbers for console index.

...

> - if (co->index >= UART_NR)
> + if (co->index < 0 || co->index >= UART_NR)
> co->index = 0;

in_range() ?

--
With Best Regards,
Andy Shevchenko