Linux IIO development
 help / color / mirror / Atom feed
* [PATCH] iio: adc: Fix refcount leak bug in aspeed_adc
@ 2022-06-17 14:41 Liang He
  0 siblings, 0 replies; only message in thread
From: Liang He @ 2022-06-17 14:41 UTC (permalink / raw)
  To: jic23, lars, joel, andrew, p.zabel, lgirdwood, broonie,
	billy_tsai, colin.king
  Cc: windhl, linux-iio, linux-arm-kernel, linux-aspeed, linux-kernel

In aspeed_adc_set_trim_data(), of_find_node_by_name() will return
a node pointer with refcount incremented. We should use of_node_put()
when it is not used anymore.

Signed-off-by: Liang He <windhl@126.com>
---
 drivers/iio/adc/aspeed_adc.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/iio/adc/aspeed_adc.c b/drivers/iio/adc/aspeed_adc.c
index 0793d2474cdc..9341e0e0eb55 100644
--- a/drivers/iio/adc/aspeed_adc.c
+++ b/drivers/iio/adc/aspeed_adc.c
@@ -186,6 +186,7 @@ static int aspeed_adc_set_trim_data(struct iio_dev *indio_dev)
 		return -EOPNOTSUPP;
 	}
 	scu = syscon_node_to_regmap(syscon);
+	of_node_put(syscon);
 	if (IS_ERR(scu)) {
 		dev_warn(data->dev, "Failed to get syscon regmap\n");
 		return -EOPNOTSUPP;
-- 
2.25.1


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2022-06-17 15:14 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-06-17 14:41 [PATCH] iio: adc: Fix refcount leak bug in aspeed_adc Liang He

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox