aboutsummaryrefslogtreecommitdiffstats
path: root/sound/core
diff options
context:
space:
mode:
Diffstat (limited to 'sound/core')
-rw-r--r--sound/core/control.c3
-rw-r--r--sound/core/init.c3
-rw-r--r--sound/core/oss/linear.c3
-rw-r--r--sound/core/pcm_native.c8
-rw-r--r--sound/core/seq/seq_queue.c2
5 files changed, 1 insertions, 18 deletions
diff --git a/sound/core/control.c b/sound/core/control.c
index 5d98194bcad5..f8c5be464510 100644
--- a/sound/core/control.c
+++ b/sound/core/control.c
@@ -704,13 +704,12 @@ static int snd_ctl_elem_list(struct snd_card *card,
704 struct snd_ctl_elem_list list; 704 struct snd_ctl_elem_list list;
705 struct snd_kcontrol *kctl; 705 struct snd_kcontrol *kctl;
706 struct snd_ctl_elem_id *dst, *id; 706 struct snd_ctl_elem_id *dst, *id;
707 unsigned int offset, space, first, jidx; 707 unsigned int offset, space, jidx;
708 708
709 if (copy_from_user(&list, _list, sizeof(list))) 709 if (copy_from_user(&list, _list, sizeof(list)))
710 return -EFAULT; 710 return -EFAULT;
711 offset = list.offset; 711 offset = list.offset;
712 space = list.space; 712 space = list.space;
713 first = 0;
714 /* try limit maximum space */ 713 /* try limit maximum space */
715 if (space > 16384) 714 if (space > 16384)
716 return -ENOMEM; 715 return -ENOMEM;
diff --git a/sound/core/init.c b/sound/core/init.c
index 30ecad41403c..2c041bb36ab3 100644
--- a/sound/core/init.c
+++ b/sound/core/init.c
@@ -342,7 +342,6 @@ static const struct file_operations snd_shutdown_f_ops =
342int snd_card_disconnect(struct snd_card *card) 342int snd_card_disconnect(struct snd_card *card)
343{ 343{
344 struct snd_monitor_file *mfile; 344 struct snd_monitor_file *mfile;
345 struct file *file;
346 int err; 345 int err;
347 346
348 if (!card) 347 if (!card)
@@ -366,8 +365,6 @@ int snd_card_disconnect(struct snd_card *card)
366 365
367 spin_lock(&card->files_lock); 366 spin_lock(&card->files_lock);
368 list_for_each_entry(mfile, &card->files_list, list) { 367 list_for_each_entry(mfile, &card->files_list, list) {
369 file = mfile->file;
370
371 /* it's critical part, use endless loop */ 368 /* it's critical part, use endless loop */
372 /* we have no room to fail */ 369 /* we have no room to fail */
373 mfile->disconnected_f_op = mfile->file->f_op; 370 mfile->disconnected_f_op = mfile->file->f_op;
diff --git a/sound/core/oss/linear.c b/sound/core/oss/linear.c
index 13b3f6f49fae..2045697f449d 100644
--- a/sound/core/oss/linear.c
+++ b/sound/core/oss/linear.c
@@ -90,11 +90,8 @@ static snd_pcm_sframes_t linear_transfer(struct snd_pcm_plugin *plugin,
90 struct snd_pcm_plugin_channel *dst_channels, 90 struct snd_pcm_plugin_channel *dst_channels,
91 snd_pcm_uframes_t frames) 91 snd_pcm_uframes_t frames)
92{ 92{
93 struct linear_priv *data;
94
95 if (snd_BUG_ON(!plugin || !src_channels || !dst_channels)) 93 if (snd_BUG_ON(!plugin || !src_channels || !dst_channels))
96 return -ENXIO; 94 return -ENXIO;
97 data = (struct linear_priv *)plugin->extra_data;
98 if (frames == 0) 95 if (frames == 0)
99 return 0; 96 return 0;
100#ifdef CONFIG_SND_DEBUG 97#ifdef CONFIG_SND_DEBUG
diff --git a/sound/core/pcm_native.c b/sound/core/pcm_native.c
index b597408d5faa..1c6be91dfb98 100644
--- a/sound/core/pcm_native.c
+++ b/sound/core/pcm_native.c
@@ -1527,13 +1527,11 @@ static int snd_pcm_drain(struct snd_pcm_substream *substream,
1527static int snd_pcm_drop(struct snd_pcm_substream *substream) 1527static int snd_pcm_drop(struct snd_pcm_substream *substream)
1528{ 1528{
1529 struct snd_pcm_runtime *runtime; 1529 struct snd_pcm_runtime *runtime;
1530 struct snd_card *card;
1531 int result = 0; 1530 int result = 0;
1532 1531
1533 if (PCM_RUNTIME_CHECK(substream)) 1532 if (PCM_RUNTIME_CHECK(substream))
1534 return -ENXIO; 1533 return -ENXIO;
1535 runtime = substream->runtime; 1534 runtime = substream->runtime;
1536 card = substream->pcm->card;
1537 1535
1538 if (runtime->status->state == SNDRV_PCM_STATE_OPEN || 1536 if (runtime->status->state == SNDRV_PCM_STATE_OPEN ||
1539 runtime->status->state == SNDRV_PCM_STATE_DISCONNECTED || 1537 runtime->status->state == SNDRV_PCM_STATE_DISCONNECTED ||
@@ -2065,7 +2063,6 @@ static int snd_pcm_open_file(struct file *file,
2065{ 2063{
2066 struct snd_pcm_file *pcm_file; 2064 struct snd_pcm_file *pcm_file;
2067 struct snd_pcm_substream *substream; 2065 struct snd_pcm_substream *substream;
2068 struct snd_pcm_str *str;
2069 int err; 2066 int err;
2070 2067
2071 if (rpcm_file) 2068 if (rpcm_file)
@@ -2082,7 +2079,6 @@ static int snd_pcm_open_file(struct file *file,
2082 } 2079 }
2083 pcm_file->substream = substream; 2080 pcm_file->substream = substream;
2084 if (substream->ref_count == 1) { 2081 if (substream->ref_count == 1) {
2085 str = substream->pstr;
2086 substream->file = pcm_file; 2082 substream->file = pcm_file;
2087 substream->pcm_release = pcm_release_private; 2083 substream->pcm_release = pcm_release_private;
2088 } 2084 }
@@ -3024,11 +3020,9 @@ static const struct vm_operations_struct snd_pcm_vm_ops_status =
3024static int snd_pcm_mmap_status(struct snd_pcm_substream *substream, struct file *file, 3020static int snd_pcm_mmap_status(struct snd_pcm_substream *substream, struct file *file,
3025 struct vm_area_struct *area) 3021 struct vm_area_struct *area)
3026{ 3022{
3027 struct snd_pcm_runtime *runtime;
3028 long size; 3023 long size;
3029 if (!(area->vm_flags & VM_READ)) 3024 if (!(area->vm_flags & VM_READ))
3030 return -EINVAL; 3025 return -EINVAL;
3031 runtime = substream->runtime;
3032 size = area->vm_end - area->vm_start; 3026 size = area->vm_end - area->vm_start;
3033 if (size != PAGE_ALIGN(sizeof(struct snd_pcm_mmap_status))) 3027 if (size != PAGE_ALIGN(sizeof(struct snd_pcm_mmap_status)))
3034 return -EINVAL; 3028 return -EINVAL;
@@ -3063,11 +3057,9 @@ static const struct vm_operations_struct snd_pcm_vm_ops_control =
3063static int snd_pcm_mmap_control(struct snd_pcm_substream *substream, struct file *file, 3057static int snd_pcm_mmap_control(struct snd_pcm_substream *substream, struct file *file,
3064 struct vm_area_struct *area) 3058 struct vm_area_struct *area)
3065{ 3059{
3066 struct snd_pcm_runtime *runtime;
3067 long size; 3060 long size;
3068 if (!(area->vm_flags & VM_READ)) 3061 if (!(area->vm_flags & VM_READ))
3069 return -EINVAL; 3062 return -EINVAL;
3070 runtime = substream->runtime;
3071 size = area->vm_end - area->vm_start; 3063 size = area->vm_end - area->vm_start;
3072 if (size != PAGE_ALIGN(sizeof(struct snd_pcm_mmap_control))) 3064 if (size != PAGE_ALIGN(sizeof(struct snd_pcm_mmap_control)))
3073 return -EINVAL; 3065 return -EINVAL;
diff --git a/sound/core/seq/seq_queue.c b/sound/core/seq/seq_queue.c
index e7a8e9e4edb2..f9077361c119 100644
--- a/sound/core/seq/seq_queue.c
+++ b/sound/core/seq/seq_queue.c
@@ -467,13 +467,11 @@ int snd_seq_queue_timer_open(int queueid)
467int snd_seq_queue_timer_close(int queueid) 467int snd_seq_queue_timer_close(int queueid)
468{ 468{
469 struct snd_seq_queue *queue; 469 struct snd_seq_queue *queue;
470 struct snd_seq_timer *tmr;
471 int result = 0; 470 int result = 0;
472 471
473 queue = queueptr(queueid); 472 queue = queueptr(queueid);
474 if (queue == NULL) 473 if (queue == NULL)
475 return -EINVAL; 474 return -EINVAL;
476 tmr = queue->timer;
477 snd_seq_timer_close(queue); 475 snd_seq_timer_close(queue);
478 queuefree(queue); 476 queuefree(queue);
479 return result; 477 return result;