| From 8308a09e87d2cb51adb186dc7d5a5c1913fb0758 Mon Sep 17 00:00:00 2001 |
| From: =?UTF-8?q?Amadeusz=20S=C5=82awi=C5=84ski?= |
| <amadeuszx.slawinski@linux.intel.com> |
| Date: Mon, 24 Feb 2020 07:52:02 -0500 |
| Subject: ASoC: Intel: Skylake: Fix available clock counter incrementation |
| MIME-Version: 1.0 |
| Content-Type: text/plain; charset=UTF-8 |
| Content-Transfer-Encoding: 8bit |
| |
| From: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com> |
| |
| 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> |
| |
| --- |
| sound/soc/intel/skylake/skl-ssp-clk.c | 4 +++- |
| 1 file changed, 3 insertions(+), 1 deletion(-) |
| |
| --- 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 plat |
| &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); |