Update of /cvsroot/alsa/alsa-kernel/core
In directory usw-pr-cvs1:/tmp/cvs-serv21131

Modified Files:
        device.c 
Log Message:
use list_for_each_safe() in snd_device_free_all() to avoid
possible double-free of elements.



Index: device.c
===================================================================
RCS file: /cvsroot/alsa/alsa-kernel/core/device.c,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- device.c    12 Aug 2002 08:43:44 -0000      1.8
+++ device.c    7 Oct 2002 16:00:46 -0000       1.9
@@ -116,14 +116,14 @@
 int snd_device_free_all(snd_card_t *card, snd_device_cmd_t cmd)
 {
        snd_device_t *dev;
-       struct list_head *list;
+       struct list_head *list, *next;
        int err, range_low, range_high;
 
        snd_assert(card != NULL, return -ENXIO);
        range_low = cmd * SNDRV_DEV_TYPE_RANGE_SIZE;
        range_high = range_low + SNDRV_DEV_TYPE_RANGE_SIZE - 1;
       __again:
-       list_for_each(list, &card->devices) {
+       list_for_each_safe(list, next, &card->devices) {
                dev = snd_device(list);         
                if (dev->type >= range_low && dev->type <= range_high) {
                        if ((err = snd_device_free(card, dev->device_data)) < 0)



-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
Alsa-cvslog mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/alsa-cvslog

Reply via email to