linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* kfree error oops
@ 2005-01-11  8:23 selvakumar nagendran
  2005-01-11  8:33 ` Arjan van de Ven
  0 siblings, 1 reply; 2+ messages in thread
From: selvakumar nagendran @ 2005-01-11  8:23 UTC (permalink / raw)
  To: linux-kernel

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);
}
--------------
<1>Unable to handle kernel paging request at virtual
address 170fc2ad
Jan 10 14:57:17 cbl032 kernel:  printing eip:
d076b210
*pde = 00000000
Oops: 0000
CPU:    0
EIP:    0010:[<d076b210>]    Not tainted
EFLAGS: 00010206
eax: 170fc2a5   ebx: ca502000   ecx: 00000020   edx:
ffffffff
esi: 00000400   edi: 00000000   ebp: bffffb98   esp:
ca503fa4
Jan 10 14:57:17 cbl032 random: Saving random seed: 
failed
ds: 0018   es: 0018   ss: 0018
Process initlog (pid: 6677, stackpage=ca503000)
Stack: 00000020 ffffffff 00000001 c01166c0 bffffb98
c0108ccc ca502000 c0108bdb 
       00000020 4b26f940 00000020 00000400 00000000
bffffb98 00000006 0000002b 
       0000002b 00000006 4b208ba1 00000023 00000246
bffffb4c 0000002b 
Call Trace:    [<c01166c0>] [<c0108ccc>] [<c0108bdb>]

Code: 8b 40 08 8b 40 08 8b 50 28 89 54 24 04 c7 44 24
08 01 00 00 
 



		
__________________________________ 
Do you Yahoo!? 
Yahoo! Mail - 250MB free storage. Do more. Manage less. 
http://info.mail.yahoo.com/mail_250

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: kfree error oops
  2005-01-11  8:23 kfree error oops selvakumar nagendran
@ 2005-01-11  8:33 ` Arjan van de Ven
  0 siblings, 0 replies; 2+ messages in thread
From: Arjan van de Ven @ 2005-01-11  8:33 UTC (permalink / raw)
  To: selvakumar nagendran; +Cc: linux-kernel

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.



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2005-01-11  8:33 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-01-11  8:23 kfree error oops selvakumar nagendran
2005-01-11  8:33 ` Arjan van de Ven

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).