浏览代码

ASoC: sst_platform: free the resources on fail path

Signed-off-by: Lu Guanqun <guanqun.lu@intel.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Lu Guanqun 14 年之前
父节点
当前提交
83a3fd3cf0
共有 1 个文件被更改,包括 2 次插入0 次删除
  1. 2 0
      sound/soc/mid-x86/sst_platform.c

+ 2 - 0
sound/soc/mid-x86/sst_platform.c

@@ -252,6 +252,8 @@ static int sst_platform_open(struct snd_pcm_substream *substream)
 	ret_val = register_sst_card(stream->sstdrv_ops);
 	if (ret_val) {
 		pr_err("sst: sst card registration failed\n");
+		kfree(stream->sstdrv_ops);
+		kfree(stream);
 		return ret_val;
 	}
 	runtime->private_data = stream;