[alsa-devel] [PATCHv2] ALSA: Support Media Vision Jazz16 chips

Rask Ingemann Lambertsen rask at sygehus.dk
Fri Apr 20 21:31:13 CEST 2007


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


More information about the Alsa-devel mailing list