From: Takashi Iwai Subject: Re: [PATCH] ALSA: snd-usb: use list_for_each_safe for endpoint resources Date: Fri, 31 Aug 2012 18:18:07 +0200 Message-ID: References: <20120830211116.15374.52284.stgit@mj> Mime-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mx2.suse.de (cantor2.suse.de [195.135.220.15]) by alsa0.perex.cz (Postfix) with ESMTP id 7D9B726646A for ; Fri, 31 Aug 2012 18:18:07 +0200 (CEST) In-Reply-To: <20120830211116.15374.52284.stgit@mj> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org To: Pavel Roskin Cc: alsa-devel@alsa-project.org List-Id: alsa-devel@alsa-project.org At Thu, 30 Aug 2012 17:11:17 -0400, Pavel Roskin wrote: > > snd_usb_endpoint_free() frees the structure that contains its argument. > > Signed-off-by: Pavel Roskin > Cc: stable@vger.kernel.org Thanks, applied now. Takashi > --- > > sound/usb/card.c | 4 ++-- > 1 files changed, 2 insertions(+), 2 deletions(-) > > diff --git a/sound/usb/card.c b/sound/usb/card.c > index d5b5c33..4a469f0 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 */ >