aboutsummaryrefslogtreecommitdiffstats
path: root/sound/core
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2008-11-03 13:14:59 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2008-11-03 13:14:59 -0500
commit20ebc0073b0fb63ce4a27ca761418ecfdecaadb7 (patch)
treee536365120ae7ec3d8622e75d847c44460dc84f1 /sound/core
parentc8126cc6025972629044cde750cec97f175792f7 (diff)
parent7aeb6d7d20185b7cede1ce5f6bd8d762e49bda6d (diff)
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound-2.6
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound-2.6: ALSA: hda: make a STAC_DELL_EQ option ALSA: emu10k1 - Add more invert_shared_spdif flag to Audigy models ALSA: hda - Add a quirk for another Acer Aspire (1025:0090) ALSA: remove direct access of dev->bus_id in sound/isa/* sound: struct device - replace bus_id with dev_name(), dev_set_name() ALSA: Fix PIT lockup on some chipsets when using the PC-Speaker ALSA: rawmidi - Add open check in rawmidi callbacks ALSA: hda - Add digital-mic for ALC269 auto-probe mode ALSA: hda - Disable broken mic auto-muting in Realtek codes
Diffstat (limited to 'sound/core')
-rw-r--r--sound/core/rawmidi.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/sound/core/rawmidi.c b/sound/core/rawmidi.c
index c4995c9f5730..39672f68ce5d 100644
--- a/sound/core/rawmidi.c
+++ b/sound/core/rawmidi.c
@@ -148,6 +148,8 @@ static int snd_rawmidi_runtime_free(struct snd_rawmidi_substream *substream)
148 148
149static inline void snd_rawmidi_output_trigger(struct snd_rawmidi_substream *substream,int up) 149static inline void snd_rawmidi_output_trigger(struct snd_rawmidi_substream *substream,int up)
150{ 150{
151 if (!substream->opened)
152 return;
151 if (up) { 153 if (up) {
152 tasklet_hi_schedule(&substream->runtime->tasklet); 154 tasklet_hi_schedule(&substream->runtime->tasklet);
153 } else { 155 } else {
@@ -158,6 +160,8 @@ static inline void snd_rawmidi_output_trigger(struct snd_rawmidi_substream *subs
158 160
159static void snd_rawmidi_input_trigger(struct snd_rawmidi_substream *substream, int up) 161static void snd_rawmidi_input_trigger(struct snd_rawmidi_substream *substream, int up)
160{ 162{
163 if (!substream->opened)
164 return;
161 substream->ops->trigger(substream, up); 165 substream->ops->trigger(substream, up);
162 if (!up && substream->runtime->event) 166 if (!up && substream->runtime->event)
163 tasklet_kill(&substream->runtime->tasklet); 167 tasklet_kill(&substream->runtime->tasklet);
@@ -857,6 +861,8 @@ int snd_rawmidi_receive(struct snd_rawmidi_substream *substream,
857 int result = 0, count1; 861 int result = 0, count1;
858 struct snd_rawmidi_runtime *runtime = substream->runtime; 862 struct snd_rawmidi_runtime *runtime = substream->runtime;
859 863
864 if (!substream->opened)
865 return -EBADFD;
860 if (runtime->buffer == NULL) { 866 if (runtime->buffer == NULL) {
861 snd_printd("snd_rawmidi_receive: input is not active!!!\n"); 867 snd_printd("snd_rawmidi_receive: input is not active!!!\n");
862 return -EINVAL; 868 return -EINVAL;
@@ -1126,6 +1132,8 @@ int snd_rawmidi_transmit_ack(struct snd_rawmidi_substream *substream, int count)
1126int snd_rawmidi_transmit(struct snd_rawmidi_substream *substream, 1132int snd_rawmidi_transmit(struct snd_rawmidi_substream *substream,
1127 unsigned char *buffer, int count) 1133 unsigned char *buffer, int count)
1128{ 1134{
1135 if (!substream->opened)
1136 return -EBADFD;
1129 count = snd_rawmidi_transmit_peek(substream, buffer, count); 1137 count = snd_rawmidi_transmit_peek(substream, buffer, count);
1130 if (count < 0) 1138 if (count < 0)
1131 return count; 1139 return count;