Skip to contentSkip to conversation

Input: synaptics-rmi4 - Fix error handling in SPI transport driver

PATCH Superseded Guenter Roeck 1 participant 1 message Oct 1, 2016

Subsystems (2)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Input: synaptics-rmi4 - Fix error handling in SPI transport driver

Instantiating the rmi4 SPI transport driver without an interrupt assigned caused the driver to fail to load, but it does not clean up its transport device registration. Result may be a crash at a later time, for example when rebooting the system.

Fixes 8d99758dee31 ("Input: synaptics-rmi4 - add SPI transport driver")
Cc Andrew Duggan <[email protected]>
---
 drivers/input/rmi4/rmi_spi.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/input/rmi4/rmi_spi.c +3 -1
index 55bd1b34970c..f8484b7cdead 100644
@@ -466,8 +466,10 @@ static int rmi_spi_probe(struct spi_device *spi)
 	}
 
 	retval = rmi_spi_init_irq(spi);
-	if (retval < 0)
+	if (retval < 0) {
+		rmi_unregister_transport_device(&rmi_spi->xport);
 		return retval;
+	}
 
 	dev_info(&spi->dev, "registered RMI SPI driver\n");
 	return 0;
Signature · 1 line
2.5.0