1
0
Fork 0
alistair23-linux/sound/pci/riptide
Dan Carpenter e4940626de ALSA: off by one bug in snd_riptide_joystick_probe()
The problem here is that we check:

	if (dev >= SNDRV_CARDS)

Then we increment "dev".

       if (!joystick_port[dev++])

Then we use it as an offset into a array with SNDRV_CARDS elements.

	if (!request_region(joystick_port[dev], 8, "Riptide gameport")) {

This has 3 effects:
1) If you use the module option to specify the joystick port then it has
   to be shifted one space over.
2) The wrong error message will be printed on failure if you have over
   32 cards.
3) Static checkers will correctly complain that are off by one.

Fixes: db1005ec6f ('ALSA: riptide - Fix joystick resource handling')
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2015-02-09 14:57:15 +01:00
..
Makefile [ALSA] Add snd-riptide driver for Conexant Riptide chip 2006-03-31 17:58:57 +02:00
riptide.c ALSA: off by one bug in snd_riptide_joystick_probe() 2015-02-09 14:57:15 +01:00