[RFC PATCH 11/13] sound: atmel-pcm-dma: check pointer before dereference

From
Richard Genoud <hidden>
Date
2013-07-01 08:40:24
Also in
linux-devicetree, lkml
Reply to
Richard Genoud, 2013-07-01
If platform_data is NULL, filter() is called with a NULL slave
parameter.

Signed-off-by: Richard Genoud <redacted>
---
 sound/soc/atmel/atmel-pcm-dma.c |    3 +++
 1 file changed, 3 insertions(+)
diff --git a/sound/soc/atmel/atmel-pcm-dma.c b/sound/soc/atmel/atmel-pcm-dma.c
index 1d38fd0..b20dbba 100644
--- a/sound/soc/atmel/atmel-pcm-dma.c
+++ b/sound/soc/atmel/atmel-pcm-dma.c
@@ -96,6 +96,9 @@ static bool filter(struct dma_chan *chan, void *slave)
 {
 	struct at_dma_slave *sl = slave;
 
+	if (!sl)
+		return false;
+
 	if (sl->dma_dev == chan->device->dev) {
 		chan->private = sl;
 		return true;
-- 
1.7.10.4
Thread (33 messages) 33 messages, 3 authors, last reply 2013-07-08
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help