[alsa-devel] [PATCH] ASoC: dapm: Fix pointer dereference in is_connected_output_ep()

Peter Ujfalusi peter.ujfalusi at ti.com
Thu Mar 14 21:26:24 CET 2013


*path is not yet initialized when we check if the widget is connected.

The compiler also warns about this:
sound/soc/soc-dapm.c: In function 'is_connected_output_ep':
sound/soc/soc-dapm.c:824:18: warning: 'path' may be used uninitialized in this function

Signed-off-by: Peter Ujfalusi <peter.ujfalusi at ti.com>
---
Hi Mark, Liam,

This patch is for the for-next branch.
I got NULL pointer dereference because of this depending on the used toolchain.

Regards,
Peter

 sound/soc/soc-dapm.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/sound/soc/soc-dapm.c b/sound/soc/soc-dapm.c
index eaf9b74..33acd8b 100644
--- a/sound/soc/soc-dapm.c
+++ b/sound/soc/soc-dapm.c
@@ -821,7 +821,6 @@ static int is_connected_output_ep(struct snd_soc_dapm_widget *widget,
 		    (widget->id == snd_soc_dapm_line &&
 		     !list_empty(&widget->sources))) {
 			widget->outputs = snd_soc_dapm_suspend_check(widget);
-			path->walking = 0;
 			return widget->outputs;
 		}
 	}
-- 
1.8.1.5



More information about the Alsa-devel mailing list