From 0d26ce3403b3841fa2656df08a819fc7eaebaa17 Mon Sep 17 00:00:00 2001 From: Roel Kluin Date: Thu, 12 Nov 2009 17:43:11 +0100 Subject: sound: OSS: fix error return in dma_ioctl() The returned error should stay negative Signed-off-by: Roel Kluin Signed-off-by: Takashi Iwai --- sound/oss/audio.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'sound/oss') diff --git a/sound/oss/audio.c b/sound/oss/audio.c index b69c05b7ea7b..7df48a25c4ee 100644 --- a/sound/oss/audio.c +++ b/sound/oss/audio.c @@ -838,7 +838,7 @@ static int dma_ioctl(int dev, unsigned int cmd, void __user *arg) if ((err = audio_devs[dev]->d->prepare_for_input(dev, dmap_in->fragment_size, dmap_in->nbufs)) < 0) { spin_unlock_irqrestore(&dmap_in->lock,flags); - return -err; + return err; } dmap_in->dma_mode = DMODE_INPUT; audio_devs[dev]->enable_bits |= PCM_ENABLE_INPUT; -- cgit v1.2.3-59-g8ed1b From 02bb57aeb092cbb0dfdb50c6026dbd0c60af7644 Mon Sep 17 00:00:00 2001 From: Roel Kluin Date: Mon, 16 Nov 2009 17:05:02 +0100 Subject: sound: OSS: keep index within bounds of midi_devs[] When the {orig,midi}_dev equals num_midis, that's one too large already. Signed-off-by: Roel Kluin Signed-off-by: Takashi Iwai --- sound/oss/midi_synth.c | 2 +- sound/oss/mpu401.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'sound/oss') diff --git a/sound/oss/midi_synth.c b/sound/oss/midi_synth.c index 9e450988ed36..3bc7104c5379 100644 --- a/sound/oss/midi_synth.c +++ b/sound/oss/midi_synth.c @@ -426,7 +426,7 @@ midi_synth_open(int dev, int mode) int err; struct midi_input_info *inc; - if (orig_dev < 0 || orig_dev > num_midis || midi_devs[orig_dev] == NULL) + if (orig_dev < 0 || orig_dev >= num_midis || midi_devs[orig_dev] == NULL) return -ENXIO; midi2synth[orig_dev] = dev; diff --git a/sound/oss/mpu401.c b/sound/oss/mpu401.c index 734b8f9e2f78..0af9d24feb8f 100644 --- a/sound/oss/mpu401.c +++ b/sound/oss/mpu401.c @@ -770,7 +770,7 @@ static int mpu_synth_ioctl(int dev, unsigned int cmd, void __user *arg) midi_dev = synth_devs[dev]->midi_dev; - if (midi_dev < 0 || midi_dev > num_midis || midi_devs[midi_dev] == NULL) + if (midi_dev < 0 || midi_dev >= num_midis || midi_devs[midi_dev] == NULL) return -ENXIO; devc = &dev_conf[midi_dev]; -- cgit v1.2.3-59-g8ed1b