All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH linux dev-5.14] iio: aspeed_adc: Fix prescaler devres cleanup
@ 2021-10-05  0:00 Joel Stanley
  0 siblings, 0 replies; only message in thread
From: Joel Stanley @ 2021-10-05  0:00 UTC (permalink / raw)
  To: Patrick Williams, openbmc; +Cc: Billy Tsai

A devres hook is added for aspeed_adc_unregister_fixed_divider that
should pass a pointer to the fixed divider. It mistakenly had a pointer
to a different clock, leading to a null pointer dereference.

This change was included in v7 of the patches submitted upstream.

Fixes: ec35bd77c642 ("iio: adc: aspeed: Fix the calculate error of clock.")
Signed-off-by: Joel Stanley <joel@jms.id.au>
---
 drivers/iio/adc/aspeed_adc.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/iio/adc/aspeed_adc.c b/drivers/iio/adc/aspeed_adc.c
index d4d8ac07d40d..3e9850a43372 100644
--- a/drivers/iio/adc/aspeed_adc.c
+++ b/drivers/iio/adc/aspeed_adc.c
@@ -492,8 +492,8 @@ static int aspeed_adc_probe(struct platform_device *pdev)
 
 	data = iio_priv(indio_dev);
 	data->dev = &pdev->dev;
-	data->model_data = of_device_get_match_data(&pdev->dev);
 	platform_set_drvdata(pdev, indio_dev);
+	data->model_data = of_device_get_match_data(&pdev->dev);
 
 	data->base = devm_platform_ioremap_resource(pdev, 0);
 	if (IS_ERR(data->base))
@@ -512,7 +512,7 @@ static int aspeed_adc_probe(struct platform_device *pdev)
 
 	ret = devm_add_action_or_reset(data->dev,
 				       aspeed_adc_unregister_fixed_divider,
-				       data->clk_prescaler);
+				       data->fixed_div_clk);
 	if (ret)
 		return ret;
 	snprintf(clk_parent_name, ARRAY_SIZE(clk_parent_name), clk_name);
-- 
2.33.0


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

only message in thread, other threads:[~2021-10-05  0:02 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-05  0:00 [PATCH linux dev-5.14] iio: aspeed_adc: Fix prescaler devres cleanup Joel Stanley

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.