Skip to content

Commit 8308a09

Browse files
Amadeusz Sławińskibroonie
authored andcommitted
ASoC: Intel: Skylake: Fix available clock counter incrementation
Incrementation of avail_clk_cnt was incorrectly moved to error path. Put it back to success path. Fixes: 6ee927f ('ASoC: Intel: Skylake: Fix NULL ptr dereference when unloading clk dev') Signed-off-by: Amadeusz Sławiński <[email protected]> Reviewed-by: Cezary Rojewski <[email protected]> Reviewed-by: Pierre-Louis Bossart <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
1 parent 1c53123 commit 8308a09

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

sound/soc/intel/skylake/skl-ssp-clk.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -384,9 +384,11 @@ static int skl_clk_dev_probe(struct platform_device *pdev)
384384
&clks[i], clk_pdata, i);
385385

386386
if (IS_ERR(data->clk[data->avail_clk_cnt])) {
387-
ret = PTR_ERR(data->clk[data->avail_clk_cnt++]);
387+
ret = PTR_ERR(data->clk[data->avail_clk_cnt]);
388388
goto err_unreg_skl_clk;
389389
}
390+
391+
data->avail_clk_cnt++;
390392
}
391393

392394
platform_set_drvdata(pdev, data);

0 commit comments

Comments
 (0)