[alsa-devel] snd_usb_endpoint_free

Julia Lawall julia.lawall at lip6.fr
Wed Jun 25 08:50:33 CEST 2014



On Wed, 25 Jun 2014, Julia Lawall wrote:

> The function snd_usb_endpoint_free in sound/usb/endpoint.c is defined as 
> follows:
> 
> void snd_usb_endpoint_free(struct list_head *head)
> {
>         struct snd_usb_endpoint *ep;
> 
>         ep = list_entry(head, struct snd_usb_endpoint, list);
>         release_urbs(ep, 1);
>         kfree(ep);
> }
> 
> I wonder if the final kfree should be list_del?  In practice, this 

Sorry, the question should be "I wonder if this function should also use 
list_del", since list_del doesn't subsume kfree.

julia

> function is only used from snd_usb_audio_disconnect in sound/usb/card.c 
> where the entire list is destroyed, but it seems like quite a generic 
> function that someone may someday want to use for just freeing one entry.
> 
> julia
> 


More information about the Alsa-devel mailing list