summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPavel Roskin <proski@gnu.org>2012-08-30 17:11:17 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-09-14 09:59:39 -0700
commitcf43b1131768b8e9bf1466e569d6a16864c3ccf0 (patch)
tree73a05b8c083121db38f66065bfa45069286c7bd3
parent943a54f28e20d7938ecef3545299745ef7cbb9a6 (diff)
ALSA: snd-usb: use list_for_each_safe for endpoint resources
commit 03d2f44e967b3c2cf79a6dfb904c8880616c7f83 upstream. snd_usb_endpoint_free() frees the structure that contains its argument. Signed-off-by: Pavel Roskin <proski@gnu.org> Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--sound/usb/card.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sound/usb/card.c b/sound/usb/card.c
index d5b5c3388e28..4a469f0cb6d4 100644
--- a/sound/usb/card.c
+++ b/sound/usb/card.c
@@ -553,7 +553,7 @@ static void snd_usb_audio_disconnect(struct usb_device *dev,
struct snd_usb_audio *chip)
{
struct snd_card *card;
- struct list_head *p;
+ struct list_head *p, *n;
if (chip == (void *)-1L)
return;
@@ -570,7 +570,7 @@ static void snd_usb_audio_disconnect(struct usb_device *dev,
snd_usb_stream_disconnect(p);
}
/* release the endpoint resources */
- list_for_each(p, &chip->ep_list) {
+ list_for_each_safe(p, n, &chip->ep_list) {
snd_usb_endpoint_free(p);
}
/* release the midi resources */