--- i810_audio.c.19 Wed Jan 9 04:58:41 2002 +++ i810_audio.c.20 Thu Jan 10 16:32:29 2002 @@ -1739,7 +1739,8 @@ static int i810_ioctl(struct inode *inod #endif if (dmabuf->enable != DAC_RUNNING || file->f_flags & O_NONBLOCK) return 0; - drain_dac(state); + if(val = drain_dac(state)) + return val; dmabuf->total_bytes = 0; return 0; @@ -2417,12 +2418,16 @@ static int i810_release(struct inode *in struct i810_card *card = state->card; struct dmabuf *dmabuf = &state->dmabuf; unsigned long flags; + int ret; lock_kernel(); /* stop DMA state machine and free DMA buffers/channels */ if(dmabuf->trigger & PCM_ENABLE_OUTPUT) { - drain_dac(state); + if(ret = drain_dac(state)) { + unlock_kernel(); + return ret; + } } if(dmabuf->trigger & PCM_ENABLE_INPUT) { stop_adc(state);