Skip to contentSkip to conversation

media: cxd2880-spi: fix a reversed condition in error handling

PATCH New Dan Carpenter 1 participant 1 message Aug 5, 2021

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

PATCH 1/1 media: cxd2880-spi: fix a reversed condition in error handling

This if statement is reversed so it leads to either a NULL dereference or a leak.

Fixes dcb014582101 ("media: cxd2880-spi: Fix an error handling path")
---
 drivers/media/spi/cxd2880-spi.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/media/spi/cxd2880-spi.c +1 -1
index b91a1e845b97..506f52c1af10 100644
@@ -618,7 +618,7 @@ cxd2880_spi_probe(struct spi_device *spi)
 fail_attach:
 	dvb_unregister_adapter(&dvb_spi->adapter);
 fail_adapter:
-	if (!dvb_spi->vcc_supply)
+	if (dvb_spi->vcc_supply)
 		regulator_disable(dvb_spi->vcc_supply);
 fail_regulator:
 	kfree(dvb_spi);
Signature · 1 line
2.30.2