lkml.org 
[lkml]   [2005]   [Jan]   [11]   [last100]   RSS Feed
Views: [more markup]  [less markup]  [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: kfree error oops
FromArjan van de Ven <>
DateTue, 11 Jan 2005 09:33:44 +0100
On Tue, 2005-01-11 at 00:23 -0800, selvakumar nagendran wrote:
> Hello linux-experts,
>      While I tried to free the memory I allocated
> using kfree, I received the following error:
>   I am working in kernel 2.4.28.
>   I have also attached the code. Can anyone help me
> regarding this? I have also checked for NULL pointer
> even though it is not necessary.
> 
> Thanks,
> selva
> -----------------------
> list_for_each(p,&rhash_table[i])
> {
> 	//printk("\n Printing details for my..");
> 
> 	my = list_entry(p, struct resource, res_list);
> 	if(my)
> 	{	
> 	printk("\n My is not null..");
> 	printk("\n%ld,",  my -> rid.fd);
> 	printk("%ld,",  my -> rid.inode);
> 	printk("%d,", my -> rid.ACCESS_TYPE);
>         list_del(&my -> res_list);
>         kfree(my);

this is not allowed in list_for_each,
you must use list_for_each_safe() instead.


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 14:09    [from the cache]
©2003-2008