lkml.org 
[lkml]   [2013]   [Jul]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[RFC PATCH 11/13] sound: atmel-pcm-dma: check pointer before dereference
Date
If platform_data is NULL, filter() is called with a NULL slave
parameter.

Signed-off-by: Richard Genoud <richard.genoud@gmail.com>
---
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


\
 
 \ /
  Last update: 2013-07-01 11:21    [W:0.630 / U:0.408 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site