Skip to contentSkip to conversation

ALSA: Support Media Vision Jazz16 chips

PATCH Rask Ingemann Lambertsen 1 participant 1 message Apr 20, 2007 2 messages not in the archive

lore
Share & tools
lore
#2 lore raw
In reply to a message not in the archive
Quoted 14 lines · Rene Herman

Review

Quoted 10 lines · Rask Ingemann Lambertsen
(quoted diff) +4 -0
+	static uint dev_num = 0;
+
+	if (enable[dev_num])
+		card = snd_card_new(index[dev_num], id[dev_num], 

THIS_MODULE, 0);

(quoted diff) +5 -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.

Signature · 1 line
Rask Ingemann Lambertsen