ALSA: snd-usb: use list_for_each_safe for endpoint resources
PATCH 1/1 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 <[email protected]>
---
sound/usb/card.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-)
sound/usb/card.c +2 -2
@@ -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 */
Takashi Iwai
AppliedAt Thu, 30 Aug 2012 17:11:17 -0400,
Quoted 5 lines · Pavel Roskin
snd_usb_endpoint_free()frees the structure that contains its argument.Signed-off-by Pavel Roskin <[email protected]>
Thanks, applied now.
Takashi
Quoted 28 lines
---
sound/usb/card.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-)sound/usb/card.c +2
-2@@ -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 */