This is a note to let you know that I've just added the patch titled serial: sprd: remove redundant sprd_port cleanup to the 5.4-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: serial-sprd-remove-redundant-sprd_port-cleanup.patch and it can be found in the queue-5.4 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let <stable@xxxxxxxxxxxxxxx> know about it. commit 6d3a47886fafab898818c4a1c74e6a0e936d1c82 Author: Chunyan Zhang <chunyan.zhang@xxxxxxxxxx> Date: Wed Mar 18 18:50:49 2020 +0800 serial: sprd: remove redundant sprd_port cleanup [ Upstream commit 72534077475fc489f8358c0e214cc1a4d658c8c2 ] We don't need to cleanup sprd_port anymore, since we've dropped the way of using the sprd_port[] array to get port index. Reviewed-by: Baolin Wang <baolin.wang7@xxxxxxxxx> Signed-off-by: Chunyan Zhang <chunyan.zhang@xxxxxxxxxx> Link: https://lore.kernel.org/r/20200318105049.19623-3-zhang.lyra@xxxxxxxxx Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx> Stable-dep-of: f9608f188756 ("serial: sprd: Assign sprd_port after initialized to avoid wrong access") Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx> diff --git a/drivers/tty/serial/sprd_serial.c b/drivers/tty/serial/sprd_serial.c index e6acf2c848f39..9cf771a9cff62 100644 --- a/drivers/tty/serial/sprd_serial.c +++ b/drivers/tty/serial/sprd_serial.c @@ -1205,10 +1205,8 @@ static int sprd_probe(struct platform_device *pdev) sprd_ports_num++; ret = uart_add_one_port(&sprd_uart_driver, up); - if (ret) { - sprd_port[index] = NULL; + if (ret) sprd_remove(pdev); - } platform_set_drvdata(pdev, up);