linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Richard Weinberger <richard@nod.at>
To: linux-mtd@lists.infradead.org
Cc: linux-kernel@vger.kernel.org, adrian.hunter@intel.com,
	Heinz.Egger@linutronix.de, thomas.wucher@linutronix.de,
	shmulik.ladkani@gmail.com, tglx@linutronix.de,
	tim.bird@am.sony.com, Marius.Mazarel@ugal.ro,
	artem.bityutskiy@linux.intel.com, nyoushchenko@mvista.com,
	Richard Weinberger <richard@nod.at>
Subject: [PATCH 4/7] UBI: Fastmap: Fix double free in error path
Date: Mon,  9 Jul 2012 14:18:40 +0200	[thread overview]
Message-ID: <1341836323-43916-5-git-send-email-richard@nod.at> (raw)
In-Reply-To: <1341836323-43916-1-git-send-email-richard@nod.at>

Signed-off-by: Richard Weinberger <richard@nod.at>
---
 drivers/mtd/ubi/attach.c |    5 ++---
 1 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/mtd/ubi/attach.c b/drivers/mtd/ubi/attach.c
index 5d61ba7..85c9e0c 100644
--- a/drivers/mtd/ubi/attach.c
+++ b/drivers/mtd/ubi/attach.c
@@ -1322,7 +1322,7 @@ static int scan_fast(struct ubi_device *ubi, struct ubi_attach_info *ai)
 
 	ech = kzalloc(ubi->ec_hdr_alsize, GFP_KERNEL);
 	if (!ech)
-		goto out_ai;
+		goto out;
 
 	vidh = ubi_zalloc_vid_hdr(ubi, GFP_KERNEL);
 	if (!vidh)
@@ -1356,8 +1356,7 @@ out_vidh:
 	ubi_free_vid_hdr(ubi, vidh);
 out_ech:
 	kfree(ech);
-out_ai:
-	destroy_ai(ai);
+out:
 	return err;
 }
 static struct ubi_attach_info *alloc_ai(void)
-- 
1.7.6.5


  parent reply	other threads:[~2012-07-09 12:20 UTC|newest]

Thread overview: 43+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-07-09 12:18 UBI fastmap updates Richard Weinberger
2012-07-09 12:18 ` [PATCH 1/7] UBI: Fastmap: Fix lock imbalance in case of an error Richard Weinberger
2012-07-09 12:18 ` [PATCH 2/7] UBI: Fastmap: Get rid of find_fastmap switch Richard Weinberger
2012-07-09 12:18 ` [PATCH 3/7] UBI: Fastmap: Fix memory leak in error path Richard Weinberger
2012-07-09 12:18 ` Richard Weinberger [this message]
2012-07-09 12:18 ` [PATCH 5/7] UBI: Fastmap: Kerneldoc fixes Richard Weinberger
2012-07-09 12:18 ` [PATCH 6/7] UBI: Fastmap: Make sure that find_wl_entry() never returns NULL Richard Weinberger
2012-07-09 12:18 ` [PATCH 7/7] UBI: Fastmap: Make checkpatch.pl happy Richard Weinberger
2012-08-02 14:12 ` UBI fastmap updates Artem Bityutskiy
2012-08-02 14:15   ` Richard Weinberger
2012-08-02 14:29     ` Artem Bityutskiy
2012-08-02 14:51       ` Richard Weinberger
2012-08-02 16:17         ` Artem Bityutskiy
2012-08-02 16:32           ` Richard Weinberger
2012-08-02 16:45             ` Artem Bityutskiy
2012-08-02 16:54               ` Richard Weinberger
2012-08-02 17:03               ` Tim Bird
2012-08-02 17:06                 ` Richard Weinberger
2012-08-02 17:40                 ` Artem Bityutskiy
2012-08-02 17:45                   ` Richard Weinberger
2012-08-02 17:59                     ` Artem Bityutskiy
2012-08-02 18:03                       ` Richard Weinberger
2012-08-02 18:15                         ` Artem Bityutskiy
2012-08-05  8:23                     ` Shmulik Ladkani
2012-08-05 14:25                       ` Richard Weinberger
2012-08-02 17:50                 ` Artem Bityutskiy
2012-08-02 14:58 ` Artem Bityutskiy
2012-08-02 14:59   ` Richard Weinberger
2012-08-02 15:18     ` Artem Bityutskiy
2012-08-02 15:19       ` Richard Weinberger
2012-08-06 17:36   ` Richard Weinberger
2012-08-07  4:21     ` Artem Bityutskiy
2012-08-07  7:29       ` Richard Weinberger
2012-08-07 18:53         ` Artem Bityutskiy
2012-08-02 18:50 ` Artem Bityutskiy
2012-08-02 18:56   ` Artem Bityutskiy
2012-08-03  8:47 ` Artem Bityutskiy
2012-08-03  8:56   ` Richard Weinberger
2012-08-17 13:11 ` Artem Bityutskiy
2012-08-17 13:33   ` Richard Weinberger
2012-08-17 13:41     ` Artem Bityutskiy
2012-08-17 13:43       ` Richard Weinberger
2012-08-17 14:06         ` Artem Bityutskiy

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=1341836323-43916-5-git-send-email-richard@nod.at \
    --to=richard@nod.at \
    --cc=Heinz.Egger@linutronix.de \
    --cc=Marius.Mazarel@ugal.ro \
    --cc=adrian.hunter@intel.com \
    --cc=artem.bityutskiy@linux.intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mtd@lists.infradead.org \
    --cc=nyoushchenko@mvista.com \
    --cc=shmulik.ladkani@gmail.com \
    --cc=tglx@linutronix.de \
    --cc=thomas.wucher@linutronix.de \
    --cc=tim.bird@am.sony.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).