* [PATCH] ASoC: soc-core: Fix null pointer dereference
@ 2010-12-07 16:21 Dimitris Papastamos
2010-12-07 16:22 ` Mark Brown
0 siblings, 1 reply; 5+ messages in thread
From: Dimitris Papastamos @ 2010-12-07 16:21 UTC (permalink / raw)
To: Mark Brown, Liam Girdwood; +Cc: alsa-devel, patches
In case the codec driver did not provide a read/write function,
codec->driver->read|write will be NULL. Ensure that we use the one
specified in codec->read|write to avoid oopsing when we access
the debugfs entries.
Signed-off-by: Dimitris Papastamos <dp@opensource.wolfsonmicro.com>
---
sound/soc/soc-core.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c
index 392d336..078f9df 100644
--- a/sound/soc/soc-core.c
+++ b/sound/soc/soc-core.c
@@ -117,7 +117,7 @@ static ssize_t soc_codec_reg_show(struct snd_soc_codec *codec, char *buf)
* the register being volatile and the device being
* powered off.
*/
- ret = codec->driver->read(codec, i);
+ ret = codec->read(codec, i);
if (ret >= 0)
count += snprintf(buf + count,
PAGE_SIZE - count,
@@ -228,7 +228,7 @@ static ssize_t codec_reg_write_file(struct file *file,
start++;
if (strict_strtoul(start, 16, &value))
return -EINVAL;
- codec->driver->write(codec, reg, value);
+ codec->write(codec, reg, value);
return buf_size;
}
--
1.7.3.3
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH] ASoC: soc-core: Fix null pointer dereference
2010-12-07 16:21 Dimitris Papastamos
@ 2010-12-07 16:22 ` Mark Brown
0 siblings, 0 replies; 5+ messages in thread
From: Mark Brown @ 2010-12-07 16:22 UTC (permalink / raw)
To: Dimitris Papastamos; +Cc: alsa-devel, patches, Liam Girdwood
On Tue, Dec 07, 2010 at 04:21:06PM +0000, Dimitris Papastamos wrote:
> In case the codec driver did not provide a read/write function,
> codec->driver->read|write will be NULL. Ensure that we use the one
> specified in codec->read|write to avoid oopsing when we access
> the debugfs entries.
>
> Signed-off-by: Dimitris Papastamos <dp@opensource.wolfsonmicro.com>
These should instead be converted to use snd_soc_read() and
snd_soc_write() so we're doing all the indirection in one place.
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH] ASoC: soc-core: Fix null pointer dereference
@ 2010-12-07 16:30 Dimitris Papastamos
2010-12-08 12:04 ` Liam Girdwood
2010-12-08 13:56 ` Mark Brown
0 siblings, 2 replies; 5+ messages in thread
From: Dimitris Papastamos @ 2010-12-07 16:30 UTC (permalink / raw)
To: Mark Brown, Liam Girdwood; +Cc: alsa-devel, patches
In case the codec driver did not provide a read/write function,
codec->driver->read|write will be NULL. Ensure that we use the one
specified in codec->read|write to avoid oopsing when we access
the debugfs entries. This is achieved by using snd_soc_read() and
snd_soc_write().
Signed-off-by: Dimitris Papastamos <dp@opensource.wolfsonmicro.com>
---
sound/soc/soc-core.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c
index 392d336..ecd9146 100644
--- a/sound/soc/soc-core.c
+++ b/sound/soc/soc-core.c
@@ -117,7 +117,7 @@ static ssize_t soc_codec_reg_show(struct snd_soc_codec *codec, char *buf)
* the register being volatile and the device being
* powered off.
*/
- ret = codec->driver->read(codec, i);
+ ret = snd_soc_read(codec, i);
if (ret >= 0)
count += snprintf(buf + count,
PAGE_SIZE - count,
@@ -228,7 +228,7 @@ static ssize_t codec_reg_write_file(struct file *file,
start++;
if (strict_strtoul(start, 16, &value))
return -EINVAL;
- codec->driver->write(codec, reg, value);
+ snd_soc_write(codec, reg, value);
return buf_size;
}
--
1.7.3.3
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH] ASoC: soc-core: Fix null pointer dereference
2010-12-07 16:30 [PATCH] ASoC: soc-core: Fix null pointer dereference Dimitris Papastamos
@ 2010-12-08 12:04 ` Liam Girdwood
2010-12-08 13:56 ` Mark Brown
1 sibling, 0 replies; 5+ messages in thread
From: Liam Girdwood @ 2010-12-08 12:04 UTC (permalink / raw)
To: Dimitris Papastamos; +Cc: alsa-devel, Mark Brown, patches
On Tue, 2010-12-07 at 16:30 +0000, Dimitris Papastamos wrote:
> In case the codec driver did not provide a read/write function,
> codec->driver->read|write will be NULL. Ensure that we use the one
> specified in codec->read|write to avoid oopsing when we access
> the debugfs entries. This is achieved by using snd_soc_read() and
> snd_soc_write().
>
> Signed-off-by: Dimitris Papastamos <dp@opensource.wolfsonmicro.com>
> ---
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
--
Freelance Developer, SlimLogic Ltd
ASoC and Voltage Regulator Maintainer.
http://www.slimlogic.co.uk
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] ASoC: soc-core: Fix null pointer dereference
2010-12-07 16:30 [PATCH] ASoC: soc-core: Fix null pointer dereference Dimitris Papastamos
2010-12-08 12:04 ` Liam Girdwood
@ 2010-12-08 13:56 ` Mark Brown
1 sibling, 0 replies; 5+ messages in thread
From: Mark Brown @ 2010-12-08 13:56 UTC (permalink / raw)
To: Dimitris Papastamos; +Cc: alsa-devel, patches, Liam Girdwood
On Tue, Dec 07, 2010 at 04:30:38PM +0000, Dimitris Papastamos wrote:
> In case the codec driver did not provide a read/write function,
> codec->driver->read|write will be NULL. Ensure that we use the one
> specified in codec->read|write to avoid oopsing when we access
> the debugfs entries. This is achieved by using snd_soc_read() and
> snd_soc_write().
>
> Signed-off-by: Dimitris Papastamos <dp@opensource.wolfsonmicro.com>
Applied, thanks.
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2010-12-08 13:56 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-12-07 16:30 [PATCH] ASoC: soc-core: Fix null pointer dereference Dimitris Papastamos
2010-12-08 12:04 ` Liam Girdwood
2010-12-08 13:56 ` Mark Brown
-- strict thread matches above, loose matches on Subject: below --
2010-12-07 16:21 Dimitris Papastamos
2010-12-07 16:22 ` Mark Brown
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.