[pso] list_head si kfree()

Diaconescu pso@cursuri.cs.pub.ro
Sun, 28 Mar 2004 02:14:07 +0300


Hello Andrei,

Saturday, March 27, 2004, 8:50:49 PM, you wrote:


AC>         list_for_each(tmp, &the_list)
AC>         {
AC>                 mu = list_entry(tmp, struct monitor_unit, mu_list);
AC>                 printk( "i=(%d)\n", mu->mu_i );
AC>                 list_del( &(mu->mu_list) );     <------- Da mereu segmentation fault
AC>                 kfree(mu);                      <------- Da mereu segmentation fault
AC>         }

Read the source, Luke!

Am avut exact aceeasi problema, si a devenit evident de ce apare in
momentul in care m-am uitat prin linux/list.h

Uite aici.
http://atlantis.cs.pub.ro/lxr/http/source/include/linux/list.h

Sau raspunsul scurt: foloseste functiile (adica define-urile) list_for_each_safe() sau
list_for_each_entry_safe().



-- 
Best regards,
 Diaconescu                            mailto:diaconescu@gmx.net
--
" Computers don't make errors...
What they do, they do on purpose! "