public inbox for linux-mtd@lists.infradead.org
 help / color / mirror / Atom feed
From: "Phil Endecott" <spam_from_linux_mtd@chezphil.org>
To: <linux-mtd@lists.infradead.org>
Subject: alloc/free quesion in ixp4xx driver
Date: Thu, 17 May 2007 16:51:39 +0100	[thread overview]
Message-ID: <1179417099816@dmwebmail.belize.chezphil.org> (raw)

Dear MTD experts,

I have been looking at the MTD ixp4xx driver 
(drivers/mtd/maps/ixp4xx.c), mainly as an example of something that 
uses the ixp4xx expansion bus, and I have a couple of questions.  I 
apologise for being a "newbie" on this subject, I have not written a 
lot of kernel code.

- In ixp4xx_flash_probe(), a struct ixp4xx_flash_info in kalloc()ed.  
Where is it freed?

- In ixp4xx_flash_remove() you have:
       release_resource(info->res);
       kfree(info->res);
   In other places where release_resource() is called I do not see a 
call to kfree().  Is this right?

Most likely, this is all OK and I need to learn more about how these 
functions should be used.  But my thought on seeing this was that the 
kfree() should have been freeing info, not info->res.

I am also uncertain about release_resource() vs. release_mem_region().  
Are they interchangeable?

I have been looking at 2.6.21, but a quick check at 
http://git.infradead.org/?p=mtd-2.6.git;a=blob;f=drivers/mtd/maps/ixp4xx.c;h=7a828e3e6446d7f9254f083d3b02bb2e9e02e9e0;hb=HEAD 
suggests that it is the same in your tree (if I have understood gitweb properly).


Many thanks,

Phil.

P.S. I'm subscribed to the digest, so if you Cc: me in your reply I'll 
see it sooner.

             reply	other threads:[~2007-05-17 15:51 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-05-17 15:51 Phil Endecott [this message]
2007-05-17 17:08 ` alloc/free quesion in ixp4xx driver MikeW
2007-05-17 18:07   ` Phil Endecott

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=1179417099816@dmwebmail.belize.chezphil.org \
    --to=spam_from_linux_mtd@chezphil.org \
    --cc=linux-mtd@lists.infradead.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