Skip to contentSkip to conversation

serial: fix recently introduced problems in tty-next

PATCH In review Ilpo Järvinen 3 participants 5 messages Jan 23, 2023

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

cover serial: fix recently introduced problems in tty-next

One build fail due to tty-linus -> tty-next merge and one problem smatch found.

Ilpo Järvinen (2):
serial: qcom_geni: Fix variable naming
serial: liteuart: Use proper error rollback

 drivers/tty/serial/liteuart.c         |  2 +-
 drivers/tty/serial/qcom_geni_serial.c | 10 +++++-----
 2 files changed, 6 insertions(+), 6 deletions(-)
Signature · 1 line
2.30.2
#1 lore raw

PATCH 1/2 serial: qcom_geni: Fix variable naming

Commit 2aaa43c70778 ("tty: serial: qcom-geni-serial: add support for serial engine DMA") renamed rx_fifo member to rf_buf which caused a build failure when b8caf69a6946 ("tty: serial: qcom-geni-serial: fix slab-out-of-bounds on RX FIFO buffer") from tty-linus was merged into tty-next.

Fix the member variable name.

Fixes 7a6aa989f2e8 ("Merge 6.2-rc5 into tty-next")
---
 drivers/tty/serial/qcom_geni_serial.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
drivers/tty/serial/qcom_geni_serial.c +5 -5
index d98e0a8aae7c..7c49194ec8ac 100644
@@ -1055,11 +1055,11 @@ static int setup_fifos(struct qcom_geni_serial_port *port)
 	uport->fifosize =
 		(port->tx_fifo_depth * port->tx_fifo_width) / BITS_PER_BYTE;
 
-	if (port->rx_fifo && (old_rx_fifo_depth != port->rx_fifo_depth) && port->rx_fifo_depth) {
-		port->rx_fifo = devm_krealloc(uport->dev, port->rx_fifo,
-					      port->rx_fifo_depth * sizeof(u32),
-					      GFP_KERNEL);
-		if (!port->rx_fifo)
+	if (port->rx_buf && (old_rx_fifo_depth != port->rx_fifo_depth) && port->rx_fifo_depth) {
+		port->rx_buf = devm_krealloc(uport->dev, port->rx_buf,
+					     port->rx_fifo_depth * sizeof(u32),
+					     GFP_KERNEL);
+		if (!port->rx_buf)
 			return -ENOMEM;
 	}
 
Signature · 1 line
2.30.2
#2 lore raw

PATCH 2/2 serial: liteuart: Correct error rollback

In reply to Ilpo Järvinen

Goto to the correct rollback label instead of directly returning.

Fixes 5602cf99dcdc ("serial: liteuart: add IRQ support for the RX path")
---
 drivers/tty/serial/liteuart.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/tty/serial/liteuart.c +1 -1
index ef557d59e4c8..192ad681de35 100644
@@ -313,7 +313,7 @@ static int liteuart_probe(struct platform_device *pdev)
 
 	ret = platform_get_irq_optional(pdev, 0);
 	if (ret < 0 && ret != -ENXIO)
-		return ret;
+		goto err_erase_id;
 	if (ret > 0)
 		port->irq = ret;
 
Signature · 1 line
2.30.2
Reviewed-by on v1 2/2
#3 lore raw

Re: [PATCH 2/2] serial: liteuart: Correct error rollback

Quoted 15 lines · Ilpo Järvinen

Goto to the correct rollback label instead of directly returning.

Fixes 5602cf99dcdc ("serial: liteuart: add IRQ support for the RX path")
---
 drivers/tty/serial/liteuart.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/tty/serial/liteuart.c +0 -0
index ef557d59e4c8..192ad681de35 100644

drivers/tty/serial/liteuart.c static int liteuart_probe(struct platform_device *pdev) · line 316

Quoted 5 lines
drivers/tty/serial/liteuart.c +1 -1
@@ -313,7 +313,7 @@ static int liteuart_probe(struct platform_device *pdev)
 
 	ret = platform_get_irq_optional(pdev, 0);
 	if (ret < 0 && ret != -ENXIO)
-		return ret;
+		goto err_erase_id;

That was my mistake, sorry, and thanks for the super-quick fix! :)

Quoted 6 lines
drivers/tty/serial/liteuart.c +0 -0
 	if (ret > 0)
 		port->irq = ret;
 
Signature · 1 line
2.30.2
#4 lore raw
In reply to Ilpo Järvinen
Quoted 14 lines · Ilpo Järvinen

One build fail due to tty-linus -> tty-next merge and one problem smatch found.

Ilpo Järvinen (2):
serial: qcom_geni: Fix variable naming
serial: liteuart: Use proper error rollback

 drivers/tty/serial/liteuart.c         |  2 +-
 drivers/tty/serial/qcom_geni_serial.c | 10 +++++-----
 2 files changed, 6 insertions(+), 6 deletions(-)
Signature · 1 line
2.30.2

Oh nice, you beat me too it!

thanks for these, I'll go queue them up right now.

greg k-h