Re: list corruption on removal of snd_seq_dummy

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



At Mon, 26 Jun 2006 23:27:38 -0400,
Dave Jones wrote:
> 
> On Fri, Jun 23, 2006 at 12:47:46PM +0200, Takashi Iwai wrote:
>  
>  > > The code in question is doing..
>  > > 
>  > >         __list_add(&deleted_list,
>  > >                client->ports_list_head.prev,
>  > >                client->ports_list_head.next);
>  > > 
>  > > which looks fishy, as those two elements aren't going to be consecutive,
>  > > as __list_add expects.
>  > 
>  > I think the code behaves correctly but probably misusing __list_add().
>  > It movies the whole entries from an existing list_head A
>  > (clients->ports_list_head) to a new list_head B (deleted_list).
>  > The above is exapnded:
>  > 
>  > 	A->next->prev = B;
>  > 	B->next = A->next;
>  > 	B->prev = A->prev;
>  > 	A->prev->next = B;
>  > 
>  > Any better way to achieve it using standard macros?
> 
> Why can't you just list_move() the elements ?

No, list_move() can't move the whole elements without loop.

A solution is

	list_add(B, A);
	list_del_init(A);

(although this introduces a bit more code :)


Takashi

Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Alsa-devel mailing list
Alsa-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.sourceforge.net/lists/listinfo/alsa-devel

[Index of Archives]     [ALSA User]     [Linux Audio Users]     [Kernel Archive]     [Asterisk PBX]     [Photo Sharing]     [Linux Sound]     [Video 4 Linux]     [Gimp]     [Yosemite News]

  Powered by Linux