summaryrefslogtreecommitdiff
path: root/sound/soc/intel/skylake/skl-ssp-clk.c
diff options
context:
space:
mode:
authorAmadeusz Sławiński <amadeuszx.slawinski@linux.intel.com>2020-02-24 15:52:02 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2020-03-12 15:00:26 +0300
commita87fe1f24fe73e4b9ae0a65b7f624575515b16bd (patch)
tree7737ce4d51ee8f3d8d4640901fa6212dc7a0bf2d /sound/soc/intel/skylake/skl-ssp-clk.c
parent94c472e7b4e15eb460a9fdabcfe867fd863dd2b4 (diff)
downloadlinux-a87fe1f24fe73e4b9ae0a65b7f624575515b16bd.tar.xz
ASoC: Intel: Skylake: Fix available clock counter incrementation
commit 8308a09e87d2cb51adb186dc7d5a5c1913fb0758 upstream. 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> Reviewed-by: Cezary Rojewski <cezary.rojewski@intel.com> Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Link: https://lore.kernel.org/r/20200224125202.13784-1-amadeuszx.slawinski@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'sound/soc/intel/skylake/skl-ssp-clk.c')
-rw-r--r--sound/soc/intel/skylake/skl-ssp-clk.c4
1 files changed, 3 insertions, 1 deletions
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);