From: "Phil Endecott" <spam_from_linux_mtd@chezphil.org>
To: <linux-mtd@lists.infradead.org>
Subject: Re: alloc/free quesion in ixp4xx driver
Date: Thu, 17 May 2007 19:07:32 +0100 [thread overview]
Message-ID: <1179425252983@dmwebmail.belize.chezphil.org> (raw)
In-Reply-To: <loom.20070517T190229-463@post.gmane.org>
MikeW wrote:
> Phil Endecott <spam_from_linux_mtd <at> chezphil.org> writes:
>> - 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?
> Don't think it should kfree(info->res), the release_resource() sorts
> out the allocated mem region.
>
> But there should be a kfree(info) somewhere in the driver.
>
> My guess is that you have spotted a typo, and there should be a
> kfree(info) next, just outside the if (info->res) block.
Similar issues occur in integrator-flash.c, ixp2000.c, physmap.c and physmap_of.c.
I don't have hardware where mtd can be modular; like probably 99% of
applications it's the root filesystem so it's hard to unload it. But
not being able to test it hasn't stopped me from writing a patch, which
will follow shortly. I hope that there's someone out there who can
test it!
Phil.
prev parent reply other threads:[~2007-05-17 18:07 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-05-17 15:51 alloc/free quesion in ixp4xx driver Phil Endecott
2007-05-17 17:08 ` MikeW
2007-05-17 18:07 ` Phil Endecott [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=1179425252983@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