From: Brian Norris <computersforpeace@gmail.com>
To: Dan Carpenter <dan.carpenter@oracle.com>
Cc: David Woodhouse <dwmw2@infradead.org>,
Marc St-Jean <stjeanma@pmc-sierra.com>,
linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org,
kernel-janitors@vger.kernel.org
Subject: Re: [patch] mtd: pmcmsp-flash: Allocating too much in init_msp_flash()
Date: Fri, 15 Jul 2016 22:45:39 -0700 [thread overview]
Message-ID: <20160716054539.GA20393@google.com> (raw)
In-Reply-To: <20160714104456.GG18175@mwanda>
On Thu, Jul 14, 2016 at 01:44:56PM +0300, Dan Carpenter wrote:
> There is a cut and paste issue here. The bug is that we are allocating
> more memory than necessary for msp_maps. We should be allocating enough
> space for a map_info struct (144 bytes) but we instead allocate enough
> for an mtd_info struct (1840 bytes). It's a small waste.
>
> The other part of this is not harmful but when we allocated msp_flash
> then we allocated enough space fro a map_info pointer instead of an
> mtd_info pointer. But since pointers are the same size it works out
> fine.
>
> Anyway, I decided to clean up all three allocations a bit to make them
> a bit more consistent and clear.
>
> Fixes: 68aa0fa87f6d ('[MTD] PMC MSP71xx flash/rootfs mappings')
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Applied to l2-mtd.git.
prev parent reply other threads:[~2016-07-16 5:46 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-07-14 10:44 [patch] mtd: pmcmsp-flash: Allocating too much in init_msp_flash() Dan Carpenter
2016-07-16 5:45 ` Brian Norris [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=20160716054539.GA20393@google.com \
--to=computersforpeace@gmail.com \
--cc=dan.carpenter@oracle.com \
--cc=dwmw2@infradead.org \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mtd@lists.infradead.org \
--cc=stjeanma@pmc-sierra.com \
/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).