Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 03d2f44e authored by Pavel Roskin's avatar Pavel Roskin Committed by Takashi Iwai
Browse files

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: default avatarPavel Roskin <proski@gnu.org>
Cc: stable@vger.kernel.org
Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
parent 015618b9
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -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 */