Skip to content

Commit 8a2b6b5

Browse files
Yuuoniyjic23
authored andcommitted
iio: adc: aspeed: Fix refcount leak in aspeed_adc_set_trim_data
of_find_node_by_name() returns a node pointer with refcount incremented, we should use of_node_put() on it when done. Add missing of_node_put() to avoid refcount leak. Fixes: d0a4c17 ("iio: adc: aspeed: Get and set trimming data.") Signed-off-by: Miaoqian Lin <[email protected]> Link: https://lore.kernel.org/r/[email protected] Cc: <[email protected]> Signed-off-by: Jonathan Cameron <[email protected]>
1 parent 99bded0 commit 8a2b6b5

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

drivers/iio/adc/aspeed_adc.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,7 @@ static int aspeed_adc_set_trim_data(struct iio_dev *indio_dev)
186186
return -EOPNOTSUPP;
187187
}
188188
scu = syscon_node_to_regmap(syscon);
189+
of_node_put(syscon);
189190
if (IS_ERR(scu)) {
190191
dev_warn(data->dev, "Failed to get syscon regmap\n");
191192
return -EOPNOTSUPP;

0 commit comments

Comments
 (0)