[PATCH 1/5] drivers/iio: am335x_adc: cleanup on missing DT nodes

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Currently we leak indio_dev() if the DT has no "adc" node in it.

Signed-off-by: Sebastian Andrzej Siewior <bigeasy@xxxxxxxxxxxxx>
---
 drivers/iio/adc/ti_am335x_adc.c |    6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/iio/adc/ti_am335x_adc.c b/drivers/iio/adc/ti_am335x_adc.c
index d0317fc..b2f27de 100644
--- a/drivers/iio/adc/ti_am335x_adc.c
+++ b/drivers/iio/adc/ti_am335x_adc.c
@@ -208,8 +208,10 @@ static int tiadc_probe(struct platform_device *pdev)
 	adc_dev->mfd_tscadc = tscadc_dev;
 
 	node = of_get_child_by_name(node, "adc");
-	if (!node)
-		return  -EINVAL;
+	if (!node) {
+		err = -EINVAL;
+		goto err_free_device;
+	}
 	err = of_property_read_u32(node,
 			"ti,adc-channels", &val32);
 	if (err < 0)
-- 
1.7.10.4

--
To unsubscribe from this list: send the line "unsubscribe linux-iio" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Input]     [Linux Kernel]     [Linux SCSI]     [X.org]

  Powered by Linux