20 Apr
2007
20 Apr
'07
9:31 p.m.
On Sat, Apr 14, 2007 at 03:41:01AM +0200, Rene Herman wrote:
On 04/12/2007 08:22 PM, Rask Ingemann Lambertsen wrote:
- static uint dev_num = 0;
- if (enable[dev_num])
card = snd_card_new(index[dev_num], id[dev_num],
THIS_MODULE, 0);
- else
card = NULL;
- dev_num++;
- if (card == NULL)
return enable[dev_num] ? -ENOMEM : -ENODEV;
You should also guard against dev_num overrunning SNDRV_CARDS. How about:
Oops. Also notice dev_num++ between two checks of what was supposed to be the same enable[dev_num]. :-(
I fixed the other bits as well. I'll post a new patch in a few days.
--
Rask Ingemann Lambertsen