lkml.org 
[lkml]   [2006]   [Jun]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
SubjectRe: [Patch] Check sound_alloc_mixerdev() failure in sound/oss/nm256_audio.c
From
Date
hi,

> > - if (num_mixers >= MAX_MIXER_DEV) {
> > + if ((num_mixers >= MAX_MIXER_DEV) || (num_mixers < 0)) {
> ^^^^^^^^^^
> > printk ("NM256 mixer: Unable to alloc mixerdev\n");
> > return -1;
> > }
>
> But it is _still_ fails to check it.

*yuck* I hope you keep count on the numbers of beers i owe you
by now. Here is an updated patch.

Signed-off-by: Eric Sesterhenn <snakebyte@gmx.de>

--- linux-2.6.17-rc5/sound/oss/nm256_audio.c.orig 2006-06-05 20:15:18.000000000 +0200
+++ linux-2.6.17-rc5/sound/oss/nm256_audio.c 2006-06-05 20:16:06.000000000 +0200
@@ -974,7 +974,7 @@ nm256_install_mixer (struct nm256_info *
return -1;

mixer = sound_alloc_mixerdev();
- if (num_mixers >= MAX_MIXER_DEV) {
+ if ((num_mixers >= MAX_MIXER_DEV) || (mixer < 0)) {
printk ("NM256 mixer: Unable to alloc mixerdev\n");
return -1;
}

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2006-06-05 20:21    [W:0.068 / U:0.176 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site