Skip to content

Commit

Permalink
ALSA: snd-usb: use list_for_each_safe for endpoint resources
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Pavel Roskin authored and Takashi Iwai committed Aug 31, 2012
1 parent 015618b commit 03d2f44
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions sound/usb/card.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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 */
Expand Down

0 comments on commit 03d2f44

Please sign in to comment.