summaryrefslogtreecommitdiffstats
path: root/kernel/sound/core/info.c
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/sound/core/info.c')
-rw-r--r--kernel/sound/core/info.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/kernel/sound/core/info.c b/kernel/sound/core/info.c
index 895362a69..8ab72e0f5 100644
--- a/kernel/sound/core/info.c
+++ b/kernel/sound/core/info.c
@@ -325,10 +325,15 @@ static ssize_t snd_info_text_entry_write(struct file *file,
size_t next;
int err = 0;
+ if (!entry->c.text.write)
+ return -EIO;
pos = *offset;
if (!valid_pos(pos, count))
return -EIO;
next = pos + count;
+ /* don't handle too large text inputs */
+ if (next > 16 * 1024)
+ return -EIO;
mutex_lock(&entry->access);
buf = data->wbuffer;
if (!buf) {
@@ -366,7 +371,9 @@ static int snd_info_seq_show(struct seq_file *seq, void *p)
struct snd_info_private_data *data = seq->private;
struct snd_info_entry *entry = data->entry;
- if (entry->c.text.read) {
+ if (!entry->c.text.read) {
+ return -EIO;
+ } else {
data->rbuffer->buffer = (char *)seq; /* XXX hack! */
entry->c.text.read(entry, data->rbuffer);
}