Re: [Patch] Check sound_alloc_mixerdev() failure in sound/oss/nm256_audio.c

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Jun 01, 2006 at 11:53:28AM +0200, Eric Sesterhenn wrote:
> When sound_alloc_mixerdev() fails it returns a
> negative value, which the driver fails to check.

That's true.

> --- linux-2.6.17-rc5/sound/oss/nm256_audio.c.orig
> +++ linux-2.6.17-rc5/sound/oss/nm256_audio.c
> @@ -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) || (num_mixers < 0)) {
					     ^^^^^^^^^^
>  	printk ("NM256 mixer: Unable to alloc mixerdev\n");
>  	return -1;
>      }

But it is _still_ fails to check it.

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

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux