From: Richard Weinberger <richard@nod.at>
To: computersforpeace@gmail.com
Cc: dwmw2@infradead.org, maximlevitsky@gmail.com,
linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org,
Richard Weinberger <richard@nod.at>
Subject: [PATCH 4/6] mtd: docg3: Don't leak docg3->bbt in error path
Date: Mon, 1 Jun 2015 23:10:52 +0200 [thread overview]
Message-ID: <1433193054-26865-5-git-send-email-richard@nod.at> (raw)
In-Reply-To: <1433193054-26865-1-git-send-email-richard@nod.at>
Signed-off-by: Richard Weinberger <richard@nod.at>
---
drivers/mtd/devices/docg3.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/drivers/mtd/devices/docg3.c b/drivers/mtd/devices/docg3.c
index be5fb2b..486936b 100644
--- a/drivers/mtd/devices/docg3.c
+++ b/drivers/mtd/devices/docg3.c
@@ -1900,7 +1900,7 @@ doc_probe_device(struct docg3_cascade *cascade, int floor, struct device *dev)
ret = 0;
if (chip_id != (u16)(~chip_id_inv)) {
- goto nomem3;
+ goto nomem4;
}
switch (chip_id) {
@@ -1910,7 +1910,7 @@ doc_probe_device(struct docg3_cascade *cascade, int floor, struct device *dev)
break;
default:
doc_err("Chip id %04x is not a DiskOnChip G3 chip\n", chip_id);
- goto nomem3;
+ goto nomem4;
}
doc_set_driver_info(chip_id, mtd);
@@ -1919,6 +1919,8 @@ doc_probe_device(struct docg3_cascade *cascade, int floor, struct device *dev)
doc_reload_bbt(docg3);
return mtd;
+nomem4:
+ kfree(docg3->bbt);
nomem3:
kfree(mtd);
nomem2:
--
1.8.4.5
next prev parent reply other threads:[~2015-06-01 21:11 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-06-01 21:10 Some fixes for MTD drivers Richard Weinberger
2015-06-01 21:10 ` [PATCH 1/6] mtd: r852: Fix device_create_file() usage Richard Weinberger
2015-06-17 2:07 ` Brian Norris
2015-06-01 21:10 ` [PATCH 2/6] mtd: nandsim: Fix kasprintf() usage Richard Weinberger
2015-06-17 2:07 ` Brian Norris
2015-06-17 4:42 ` Joe Perches
2015-06-01 21:10 ` [PATCH 3/6] mtd: cs553x_nand: " Richard Weinberger
2015-06-01 21:10 ` Richard Weinberger [this message]
2015-06-01 21:10 ` [PATCH 5/6] mtd: docg3: " Richard Weinberger
2015-06-01 21:10 ` [PATCH 6/6] mtd: docg3: Don't do ERR_PTR(0) Richard Weinberger
2015-06-17 18:41 ` Brian Norris
2015-06-23 6:27 ` Richard Weinberger
2015-06-23 20:41 ` Robert Jarzmik
2015-06-25 2:29 ` Brian Norris
2015-06-25 17:14 ` Robert Jarzmik
2015-06-26 0:23 ` Brian Norris
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=1433193054-26865-5-git-send-email-richard@nod.at \
--to=richard@nod.at \
--cc=computersforpeace@gmail.com \
--cc=dwmw2@infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mtd@lists.infradead.org \
--cc=maximlevitsky@gmail.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
all inboxes | Powered by JetHome®