summaryrefslogtreecommitdiffstats
path: root/sound
diff options
context:
space:
mode:
authorPavel Roskin <proski@gnu.org>2012-08-30 17:11:17 -0400
committerTakashi Iwai <tiwai@suse.de>2012-08-31 18:17:45 +0200
commit03d2f44e967b3c2cf79a6dfb904c8880616c7f83 (patch)
treee709e782d833e38f7610fd03d549c0d7d0a3a8de /sound
parent015618b902ae8e28705b7af9b4668615fea48ddd (diff)
ALSA: snd-usb: use list_for_each_safe for endpoint resources
snd_usb_endpoint_free() frees the structure that contains its argument. Signed-off-by: Pavel Roskin <proski@gnu.org> Cc: stable@vger.kernel.org Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound')
-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 d5b5c3388e2..4a469f0cb6d 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 */