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
This commit is contained in:
@ -148,6 +148,8 @@ static int snd_rawmidi_runtime_free(struct snd_rawmidi_substream *substream)
|
||||
|
||||
static inline void snd_rawmidi_output_trigger(struct snd_rawmidi_substream *substream,int up)
|
||||
{
|
||||
if (!substream->opened)
|
||||
return;
|
||||
if (up) {
|
||||
tasklet_hi_schedule(&substream->runtime->tasklet);
|
||||
} else {
|
||||
@ -158,6 +160,8 @@ static inline void snd_rawmidi_output_trigger(struct snd_rawmidi_substream *subs
|
||||
|
||||
static void snd_rawmidi_input_trigger(struct snd_rawmidi_substream *substream, int up)
|
||||
{
|
||||
if (!substream->opened)
|
||||
return;
|
||||
substream->ops->trigger(substream, up);
|
||||
if (!up && substream->runtime->event)
|
||||
tasklet_kill(&substream->runtime->tasklet);
|
||||
@ -857,6 +861,8 @@ int snd_rawmidi_receive(struct snd_rawmidi_substream *substream,
|
||||
int result = 0, count1;
|
||||
struct snd_rawmidi_runtime *runtime = substream->runtime;
|
||||
|
||||
if (!substream->opened)
|
||||
return -EBADFD;
|
||||
if (runtime->buffer == NULL) {
|
||||
snd_printd("snd_rawmidi_receive: input is not active!!!\n");
|
||||
return -EINVAL;
|
||||
@ -1126,6 +1132,8 @@ int snd_rawmidi_transmit_ack(struct snd_rawmidi_substream *substream, int count)
|
||||
int snd_rawmidi_transmit(struct snd_rawmidi_substream *substream,
|
||||
unsigned char *buffer, int count)
|
||||
{
|
||||
if (!substream->opened)
|
||||
return -EBADFD;
|
||||
count = snd_rawmidi_transmit_peek(substream, buffer, count);
|
||||
if (count < 0)
|
||||
return count;
|
||||
|
Reference in New Issue
Block a user