mirror of
https://github.com/Divested-Mobile/DivestOS-Build.git
synced 2024-10-01 01:35:54 -04:00
117 lines
4.4 KiB
Diff
117 lines
4.4 KiB
Diff
From 578eb74435eccdc3df516fd744941a7d872fac6c Mon Sep 17 00:00:00 2001
|
|
From: Xiaojun Sang <xsang@codeaurora.org>
|
|
Date: Fri, 24 Feb 2017 16:13:20 +0800
|
|
Subject: ASoC: msm: qdsp6v2: set pointer to NULL after free.
|
|
|
|
Pointer after kfree is not sanitized.
|
|
Set pointer to NULL.
|
|
|
|
CRs-Fixed: 2008031
|
|
Change-Id: Ia59a57fcd142a6ed18d168992b8da4019314afa4
|
|
Signed-off-by: Xiaojun Sang <xsang@codeaurora.org>
|
|
Signed-off-by: Bikshapathi Kothapeta <bkotha@codeaurora.org>
|
|
---
|
|
sound/soc/msm/qdsp6v2/msm-compress-q6-v2.c | 1 +
|
|
sound/soc/msm/qdsp6v2/msm-pcm-afe-v2.c | 3 ++-
|
|
sound/soc/msm/qdsp6v2/msm-pcm-lpa-v2.c | 3 ++-
|
|
sound/soc/msm/qdsp6v2/msm-pcm-q6-noirq.c | 3 ++-
|
|
sound/soc/msm/qdsp6v2/msm-pcm-q6-v2.c | 5 ++++-
|
|
5 files changed, 11 insertions(+), 4 deletions(-)
|
|
|
|
diff --git a/sound/soc/msm/qdsp6v2/msm-compress-q6-v2.c b/sound/soc/msm/qdsp6v2/msm-compress-q6-v2.c
|
|
index 245d2f5..0cd60c8 100644
|
|
--- a/sound/soc/msm/qdsp6v2/msm-compress-q6-v2.c
|
|
+++ b/sound/soc/msm/qdsp6v2/msm-compress-q6-v2.c
|
|
@@ -1138,6 +1138,7 @@ static int msm_compr_free(struct snd_compr_stream *cstream)
|
|
kfree(pdata->dec_params[soc_prtd->dai_link->be_id]);
|
|
pdata->dec_params[soc_prtd->dai_link->be_id] = NULL;
|
|
kfree(prtd);
|
|
+ runtime->private_data = NULL;
|
|
|
|
return 0;
|
|
}
|
|
diff --git a/sound/soc/msm/qdsp6v2/msm-pcm-afe-v2.c b/sound/soc/msm/qdsp6v2/msm-pcm-afe-v2.c
|
|
index d3d18917..8ab83d2 100644
|
|
--- a/sound/soc/msm/qdsp6v2/msm-pcm-afe-v2.c
|
|
+++ b/sound/soc/msm/qdsp6v2/msm-pcm-afe-v2.c
|
|
@@ -1,4 +1,4 @@
|
|
-/* Copyright (c) 2012-2015, The Linux Foundation. All rights reserved.
|
|
+/* Copyright (c) 2012-2017, The Linux Foundation. All rights reserved.
|
|
*
|
|
* This program is free software; you can redistribute it and/or modify
|
|
* it under the terms of the GNU General Public License version 2 and
|
|
@@ -499,6 +499,7 @@ done:
|
|
mutex_unlock(&prtd->lock);
|
|
prtd->prepared--;
|
|
kfree(prtd);
|
|
+ runtime->private_data = NULL;
|
|
return 0;
|
|
}
|
|
static int msm_afe_prepare(struct snd_pcm_substream *substream)
|
|
diff --git a/sound/soc/msm/qdsp6v2/msm-pcm-lpa-v2.c b/sound/soc/msm/qdsp6v2/msm-pcm-lpa-v2.c
|
|
index 64d3fe0..507d01a 100644
|
|
--- a/sound/soc/msm/qdsp6v2/msm-pcm-lpa-v2.c
|
|
+++ b/sound/soc/msm/qdsp6v2/msm-pcm-lpa-v2.c
|
|
@@ -1,4 +1,4 @@
|
|
-/* Copyright (c) 2012-2014, The Linux Foundation. All rights reserved.
|
|
+/* Copyright (c) 2012-2014, 2017, The Linux Foundation. All rights reserved.
|
|
*
|
|
* This program is free software; you can redistribute it and/or modify
|
|
* it under the terms of the GNU General Public License version 2 and
|
|
@@ -497,6 +497,7 @@ static int msm_pcm_playback_close(struct snd_pcm_substream *substream)
|
|
|
|
pr_debug("%s\n", __func__);
|
|
kfree(prtd);
|
|
+ runtime->private_data = NULL;
|
|
|
|
return 0;
|
|
}
|
|
diff --git a/sound/soc/msm/qdsp6v2/msm-pcm-q6-noirq.c b/sound/soc/msm/qdsp6v2/msm-pcm-q6-noirq.c
|
|
index 7c69081..de126e1 100644
|
|
--- a/sound/soc/msm/qdsp6v2/msm-pcm-q6-noirq.c
|
|
+++ b/sound/soc/msm/qdsp6v2/msm-pcm-q6-noirq.c
|
|
@@ -1,4 +1,4 @@
|
|
-/* Copyright (c) 2016, The Linux Foundation. All rights reserved.
|
|
+/* Copyright (c) 2016-2017, The Linux Foundation. All rights reserved.
|
|
*
|
|
* This program is free software; you can redistribute it and/or modify
|
|
* it under the terms of the GNU General Public License version 2 and
|
|
@@ -517,6 +517,7 @@ static int msm_pcm_close(struct snd_pcm_substream *substream)
|
|
SNDRV_PCM_STREAM_PLAYBACK :
|
|
SNDRV_PCM_STREAM_CAPTURE);
|
|
kfree(prtd);
|
|
+ runtime->private_data = NULL;
|
|
return 0;
|
|
}
|
|
|
|
diff --git a/sound/soc/msm/qdsp6v2/msm-pcm-q6-v2.c b/sound/soc/msm/qdsp6v2/msm-pcm-q6-v2.c
|
|
index 455607b..b8dbc63 100644
|
|
--- a/sound/soc/msm/qdsp6v2/msm-pcm-q6-v2.c
|
|
+++ b/sound/soc/msm/qdsp6v2/msm-pcm-q6-v2.c
|
|
@@ -1,4 +1,4 @@
|
|
-/* Copyright (c) 2012-2016, The Linux Foundation. All rights reserved.
|
|
+/* Copyright (c) 2012-2017, The Linux Foundation. All rights reserved.
|
|
*
|
|
* This program is free software; you can redistribute it and/or modify
|
|
* it under the terms of the GNU General Public License version 2 and
|
|
@@ -721,6 +721,8 @@ static int msm_pcm_playback_close(struct snd_pcm_substream *substream)
|
|
msm_pcm_routing_dereg_phy_stream(soc_prtd->dai_link->be_id,
|
|
SNDRV_PCM_STREAM_PLAYBACK);
|
|
kfree(prtd);
|
|
+ runtime->private_data = NULL;
|
|
+
|
|
return 0;
|
|
}
|
|
|
|
@@ -824,6 +826,7 @@ static int msm_pcm_capture_close(struct snd_pcm_substream *substream)
|
|
msm_pcm_routing_dereg_phy_stream(soc_prtd->dai_link->be_id,
|
|
SNDRV_PCM_STREAM_CAPTURE);
|
|
kfree(prtd);
|
|
+ runtime->private_data = NULL;
|
|
|
|
return 0;
|
|
}
|
|
--
|
|
cgit v1.1
|
|
|