]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
serial: port: Always update ->iotype in __uart_read_properties()
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Fri, 24 Jan 2025 16:10:47 +0000 (18:10 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 21 Feb 2025 13:01:35 +0000 (14:01 +0100)
commit010eb5fe22994c7c0514caa9a1bb3c984d095b5e
treec125d2fe168f82b368cae9925bcfa0b9edb8b2af
parent29c04864fba2ff891485ba1332907322a32161ea
serial: port: Always update ->iotype in __uart_read_properties()

commit e8486bd50ecf63c9a1e25271f258a8d959f2672f upstream.

The documentation of the __uart_read_properties() states that
->iotype member is always altered after the function call, but
the code doesn't do that in the case when use_defaults == false
and the value of reg-io-width is unsupported. Make sure the code
follows the documentation.

Note, the current users of the uart_read_and_validate_port_properties()
will fail and the change doesn't affect their behaviour, neither
users of uart_read_port_properties() will be affected since the
alteration happens there even in the current code flow.

Fixes: e894b6005dce ("serial: port: Introduce a common helper to read properties")
Cc: stable <stable@kernel.org>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://lore.kernel.org/r/20250124161530.398361-3-andriy.shevchenko@linux.intel.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/tty/serial/serial_port.c