public inbox for alsa-devel@alsa-project.org
 help / color / mirror / Atom feed
* [PATCH] ASoC: Intel: Skylake: Fix available clock counter incrementation
@ 2020-02-24 12:52 Amadeusz Sławiński
  2020-02-24 12:27 ` Cezary Rojewski
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Amadeusz Sławiński @ 2020-02-24 12:52 UTC (permalink / raw)
  To: Cezary Rojewski, Pierre-Louis Bossart
  Cc: moderated list:INTEL ASoC DRIVERS, Jie Yang, Takashi Iwai,
	Liam Girdwood, Mark Brown, Amadeusz Sławiński

Incrementation of avail_clk_cnt was incorrectly moved to error path. Put
it back to success path.

Fixes: 6ee927f2f01466 ('ASoC: Intel: Skylake: Fix NULL ptr dereference when unloading clk dev')
Signed-off-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com>
---
 sound/soc/intel/skylake/skl-ssp-clk.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/sound/soc/intel/skylake/skl-ssp-clk.c b/sound/soc/intel/skylake/skl-ssp-clk.c
index 1c0e5226cb5b..bd43885f3805 100644
--- a/sound/soc/intel/skylake/skl-ssp-clk.c
+++ b/sound/soc/intel/skylake/skl-ssp-clk.c
@@ -384,9 +384,11 @@ static int skl_clk_dev_probe(struct platform_device *pdev)
 				&clks[i], clk_pdata, i);
 
 		if (IS_ERR(data->clk[data->avail_clk_cnt])) {
-			ret = PTR_ERR(data->clk[data->avail_clk_cnt++]);
+			ret = PTR_ERR(data->clk[data->avail_clk_cnt]);
 			goto err_unreg_skl_clk;
 		}
+
+		data->avail_clk_cnt++;
 	}
 
 	platform_set_drvdata(pdev, data);
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2020-02-24 22:27 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-02-24 12:52 [PATCH] ASoC: Intel: Skylake: Fix available clock counter incrementation Amadeusz Sławiński
2020-02-24 12:27 ` Cezary Rojewski
2020-02-24 16:18 ` Pierre-Louis Bossart
2020-02-24 17:37   ` Amadeusz Sławiński
2020-02-24 17:42   ` Cezary Rojewski
2020-02-24 17:53     ` Pierre-Louis Bossart
2020-02-24 22:22 ` Applied "ASoC: Intel: Skylake: Fix available clock counter incrementation" to the asoc tree Mark Brown

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