From: Greg Ungerer <gerg@snapgear.com>
To: Panagiotis Issaris <panagiotis.issaris@mech.kuleuven.ac.be>,
dwmw2@infradead.org
Cc: linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2.6.11-mm1] mtd: fix INFTL failure handling
Date: Mon, 07 Mar 2005 11:12:21 +1000 [thread overview]
Message-ID: <422BAA75.9030109@snapgear.com> (raw)
In-Reply-To: <20050306175139.GA6192@mech.kuleuven.ac.be>
Hi Panagiotis,
Panagiotis Issaris wrote:
> The INFTL mount code contains a kmalloc() followed by a memset() without
> handling a possible memory allocation failure.
>
> Signed-off-by: <panagiotis.issaris@mech.kuleuven.ac.be>
OK, that looks good.
Dave do you want to take this, or do you want me to submit it?
Regards
Greg
> diff -pruN linux-2.6.11-orig/drivers/mtd/inftlmount.c linux-2.6.11-pi/drivers/mtd/inftlmount.c
> --- linux-2.6.11-orig/drivers/mtd/inftlmount.c 2005-03-05 03:08:52.000000000 +0100
> +++ linux-2.6.11-pi/drivers/mtd/inftlmount.c 2005-03-06 18:17:15.000000000 +0100
> @@ -574,6 +574,12 @@ int INFTL_mount(struct INFTLrecord *s)
>
> /* Temporary buffer to store ANAC numbers. */
> ANACtable = kmalloc(s->nb_blocks * sizeof(u8), GFP_KERNEL);
> + if (!ANACtable) {
> + printk(KERN_WARNING "INFTL: allocation of ANACtable "
> + "failed (%zd bytes)\n",
> + s->nb_blocks * sizeof(u8));
> + return -ENOMEM;
> + }
> memset(ANACtable, 0, s->nb_blocks);
>
> /*
>
--
------------------------------------------------------------------------
Greg Ungerer -- Chief Software Dude EMAIL: gerg@snapgear.com
SnapGear -- a CyberGuard Company PHONE: +61 7 3435 2888
825 Stanley St, FAX: +61 7 3891 3630
Woolloongabba, QLD, 4102, Australia WEB: http://www.SnapGear.com
prev parent reply other threads:[~2005-03-07 1:13 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-03-06 17:51 [PATCH 2.6.11-mm1] mtd: fix INFTL failure handling Panagiotis Issaris
2005-03-07 1:12 ` Greg Ungerer [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=422BAA75.9030109@snapgear.com \
--to=gerg@snapgear.com \
--cc=dwmw2@infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=panagiotis.issaris@mech.kuleuven.ac.be \
/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