Commit 7293adc
serial: stm32: Ignore return value of uart_remove_one_port() in .remove()
[ Upstream commit 6bd6cd2 ]
Returning early from stm32_usart_serial_remove() results in a resource
leak as several cleanup functions are not called. The driver core ignores
the return value and there is no possibility to clean up later.
uart_remove_one_port() only returns non-zero if there is some
inconsistency (i.e. stm32_usart_driver.state[port->line].uart_port == NULL).
This should never happen, and even if it does it's a bad idea to exit
early in the remove callback without cleaning up.
This prepares changing the prototype of struct platform_driver::remove to
return void. See commit 5c5a768 ("platform: Provide a remove callback
that returns no value") for further details about this quest.
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Link: https://lore.kernel.org/r/20230512173810.131447-2-u.kleine-koenig@pengutronix.de
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Valentin Caron <valentin.caron@foss.st.com>
Change-Id: I5f9e87e6ffacfe32332497f034191bed7eacaa7e
Reviewed-on: https://gerrit.st.com/c/mpu/oe/st/linux-stm32/+/320775
ACI: CIBUILD <MDG-smet-aci-builds@list.st.com>
Reviewed-by: Amelie DELAUNAY <amelie.delaunay@foss.st.com>
ACI: CITOOLS <MDG-smet-aci-reviews@list.st.com>
Domain-Review: Amelie DELAUNAY <amelie.delaunay@foss.st.com>1 parent 17546ea commit 7293adc
1 file changed
+1
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2044 | 2044 | | |
2045 | 2045 | | |
2046 | 2046 | | |
2047 | | - | |
2048 | 2047 | | |
2049 | 2048 | | |
2050 | 2049 | | |
2051 | | - | |
2052 | | - | |
2053 | | - | |
| 2050 | + | |
2054 | 2051 | | |
2055 | 2052 | | |
2056 | 2053 | | |
| |||
0 commit comments