From: Navid Emamdoost <navid.emamdoost@gmail.com>
To: Kyungmin Park <kyungmin.park@samsung.com>,
Miquel Raynal <miquel.raynal@bootlin.com>,
Richard Weinberger <richard@nod.at>,
Vignesh Raghavendra <vigneshr@ti.com>,
Marek Vasut <marek.vasut@gmail.com>,
Brian Norris <computersforpeace@gmail.com>,
David Woodhouse <dwmw2@infradead.org>
Cc: linux-mtd@lists.infradead.org, Navid Emamdoost <emamd001@umn.edu>,
kjlu@umn.edu, linux-kernel@vger.kernel.org,
Stephen McCamant <smccaman@umn.edu>
Subject: Re: [PATCH] mtd: onenand: prevent memory leak in onenand_scan
Date: Mon, 30 Sep 2019 16:37:17 -0500 [thread overview]
Message-ID: <CAEkB2ETTmCsuOFDsJQ8LbBPHNgckpDFn2XhVePwAQEsCRsJo6g@mail.gmail.com> (raw)
In-Reply-To: <20190925154302.17708-1-navid.emamdoost@gmail.com>
Would you please take a look at this patch?
On Wed, Sep 25, 2019 at 10:43 AM Navid Emamdoost
<navid.emamdoost@gmail.com> wrote:
>
> In onenand_scan if scan_bbt fails the allocated buffers should be
> released.
>
> Signed-off-by: Navid Emamdoost <navid.emamdoost@gmail.com>
> ---
> drivers/mtd/nand/onenand/onenand_base.c | 5 ++++-
> 1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/mtd/nand/onenand/onenand_base.c b/drivers/mtd/nand/onenand/onenand_base.c
> index 77bd32a683e1..79c01f42925a 100644
> --- a/drivers/mtd/nand/onenand/onenand_base.c
> +++ b/drivers/mtd/nand/onenand/onenand_base.c
> @@ -3977,8 +3977,11 @@ int onenand_scan(struct mtd_info *mtd, int maxchips)
> this->badblockpos = ONENAND_BADBLOCK_POS;
>
> ret = this->scan_bbt(mtd);
> - if ((!FLEXONENAND(this)) || ret)
> + if ((!FLEXONENAND(this)) || ret) {
> + kfree(this->page_buf);
> + kfree(this->oob_buf);
> return ret;
> + }
>
> /* Change Flex-OneNAND boundaries if required */
> for (i = 0; i < MAX_DIES; i++)
> --
> 2.17.1
>
--
Navid.
______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
next prev parent reply other threads:[~2019-09-30 21:37 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-09-25 15:43 [PATCH] mtd: onenand: prevent memory leak in onenand_scan Navid Emamdoost
2019-09-27 15:24 ` Markus Elfring
2019-09-30 21:37 ` Navid Emamdoost [this message]
2019-10-04 15:57 ` Miquel Raynal
2019-10-04 17:19 ` [PATCH v2] " Navid Emamdoost
2019-10-05 14:04 ` Markus Elfring
2019-10-07 8:54 ` Miquel Raynal
2019-10-04 17:20 ` [PATCH] " Navid Emamdoost
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=CAEkB2ETTmCsuOFDsJQ8LbBPHNgckpDFn2XhVePwAQEsCRsJo6g@mail.gmail.com \
--to=navid.emamdoost@gmail.com \
--cc=computersforpeace@gmail.com \
--cc=dwmw2@infradead.org \
--cc=emamd001@umn.edu \
--cc=kjlu@umn.edu \
--cc=kyungmin.park@samsung.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mtd@lists.infradead.org \
--cc=marek.vasut@gmail.com \
--cc=miquel.raynal@bootlin.com \
--cc=richard@nod.at \
--cc=smccaman@umn.edu \
--cc=vigneshr@ti.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).