aboutsummaryrefslogtreecommitdiff
path: root/lib/test_fortify/write_overflow-strncpy-src.c
diff options
context:
space:
mode:
authorLino Sanfilippo <[email protected]>2024-01-03 07:18:16 +0100
committerGreg Kroah-Hartman <[email protected]>2024-01-04 16:29:51 +0100
commit74eab89b26ac433ad857292f4707b43c1a8f0209 (patch)
tree1b4e588483d56a2dadf9c462b9f153ca799c92c9 /lib/test_fortify/write_overflow-strncpy-src.c
parentc73986913fa47e71e0b1ad7f039f6444915e8810 (diff)
serial: core, imx: do not set RS485 enabled if it is not supported
If the imx driver cannot support RS485 it nullifies the ports rs485_supported structure. But it still calls uart_get_rs485_mode() which may set the RS485_ENABLED flag nevertheless. This may lead to an attempt to configure RS485 even if it is not supported when the flag is evaluated in uart_configure_port() at port startup. Avoid this by bailing out of uart_get_rs485_mode() if the RS485_ENABLED flag is not supported by the caller. With this fix a check for RTS availability is now obsolete in the imx driver, since it can not evaluate to true any more. So remove this check. Furthermore the explicit nullifcation of rs485_supported is not needed, since the memory has already been set to zeros at allocation. So remove this, too. Fixes: 00d7a00e2a6f ("serial: imx: Fill in rs485_supported") Cc: Shawn Guo <[email protected]> Cc: Sascha Hauer <[email protected]> Cc: <[email protected]> Suggested-by: Uwe Kleine-König <[email protected]> Signed-off-by: Lino Sanfilippo <[email protected]> Reviewed-by: Ilpo Järvinen <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
Diffstat (limited to 'lib/test_fortify/write_overflow-strncpy-src.c')
0 files changed, 0 insertions, 0 deletions