linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Arjan van de Ven <arjan@infradead.org>
To: selvakumar nagendran <kernelselva@yahoo.com>
Cc: linux-kernel@vger.kernel.org
Subject: Re: kfree error oops
Date: Tue, 11 Jan 2005 09:33:44 +0100	[thread overview]
Message-ID: <1105432425.3917.15.camel@laptopd505.fenrus.org> (raw)
In-Reply-To: <20050111082332.58880.qmail@web60605.mail.yahoo.com>

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.



      reply	other threads:[~2005-01-11  8:33 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-01-11  8:23 kfree error oops selvakumar nagendran
2005-01-11  8:33 ` Arjan van de Ven [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1105432425.3917.15.camel@laptopd505.fenrus.org \
    --to=arjan@infradead.org \
    --cc=kernelselva@yahoo.com \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).