From: Saurav Girepunje <saurav.girepunje@gmail.com>
To: joern@lazybastard.org, dwmw2@infradead.org,
computersforpeace@gmail.com, marek.vasut@gmail.com,
miquel.raynal@bootlin.com, richard@nod.at, vigneshr@ti.com,
linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org
Cc: saurav.girepunje@hotmail.com
Subject: [PATCH v1] mtd: devices: phram.c: Fix multiple kfree statement from phram_setup
Date: Tue, 29 Oct 2019 22:38:49 +0530 [thread overview]
Message-ID: <20191029170849.GA6279@saurav> (raw)
Remove multiple kfree statement from phram_setup() in phram.c
Signed-off-by: Saurav Girepunje <saurav.girepunje@gmail.com>
---
Change in v1:
- Add change suggested by Miquel Raynal <miquel.raynal@bootlin.com>
"The goto statement should not describe from where it is called but the
action it is supposed to take. 'goto free_nam;' would be better."
drivers/mtd/devices/phram.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/mtd/devices/phram.c b/drivers/mtd/devices/phram.c
index c467286ca007..38f95a1517ac 100644
--- a/drivers/mtd/devices/phram.c
+++ b/drivers/mtd/devices/phram.c
@@ -243,22 +243,22 @@ static int phram_setup(const char *val)
ret = parse_num64(&start, token[1]);
if (ret) {
- kfree(name);
parse_err("illegal start address\n");
+ goto free_nam;
}
ret = parse_num64(&len, token[2]);
if (ret) {
- kfree(name);
parse_err("illegal device length\n");
+ goto free_nam;
}
ret = register_device(name, start, len);
if (!ret)
pr_info("%s device: %#llx at %#llx\n", name, len, start);
- else
- kfree(name);
+free_nam:
+ kfree(name);
return ret;
}
--
2.20.1
______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
WARNING: multiple messages have this Message-ID (diff)
From: Saurav Girepunje <saurav.girepunje@gmail.com>
To: joern@lazybastard.org, dwmw2@infradead.org,
computersforpeace@gmail.com, marek.vasut@gmail.com,
miquel.raynal@bootlin.com, richard@nod.at, vigneshr@ti.com,
linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org
Cc: saurav.girepunje@hotmail.com
Subject: [PATCH v1] mtd: devices: phram.c: Fix multiple kfree statement from phram_setup
Date: Tue, 29 Oct 2019 22:38:49 +0530 [thread overview]
Message-ID: <20191029170849.GA6279@saurav> (raw)
Remove multiple kfree statement from phram_setup() in phram.c
Signed-off-by: Saurav Girepunje <saurav.girepunje@gmail.com>
---
Change in v1:
- Add change suggested by Miquel Raynal <miquel.raynal@bootlin.com>
"The goto statement should not describe from where it is called but the
action it is supposed to take. 'goto free_nam;' would be better."
drivers/mtd/devices/phram.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/mtd/devices/phram.c b/drivers/mtd/devices/phram.c
index c467286ca007..38f95a1517ac 100644
--- a/drivers/mtd/devices/phram.c
+++ b/drivers/mtd/devices/phram.c
@@ -243,22 +243,22 @@ static int phram_setup(const char *val)
ret = parse_num64(&start, token[1]);
if (ret) {
- kfree(name);
parse_err("illegal start address\n");
+ goto free_nam;
}
ret = parse_num64(&len, token[2]);
if (ret) {
- kfree(name);
parse_err("illegal device length\n");
+ goto free_nam;
}
ret = register_device(name, start, len);
if (!ret)
pr_info("%s device: %#llx at %#llx\n", name, len, start);
- else
- kfree(name);
+free_nam:
+ kfree(name);
return ret;
}
--
2.20.1
next reply other threads:[~2019-10-29 17:09 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-10-29 17:08 Saurav Girepunje [this message]
2019-10-29 17:08 ` [PATCH v1] mtd: devices: phram.c: Fix multiple kfree statement from phram_setup Saurav Girepunje
2019-10-30 8:20 ` Miquel Raynal
2019-10-30 8:20 ` Miquel Raynal
[not found] ` <CAEZuxTSjS=0CP0+tJOst23pX+-g1cXoDcX1Jemz+8s4NTokKUg@mail.gmail.com>
2019-10-30 13:33 ` Miquel Raynal
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=20191029170849.GA6279@saurav \
--to=saurav.girepunje@gmail.com \
--cc=computersforpeace@gmail.com \
--cc=dwmw2@infradead.org \
--cc=joern@lazybastard.org \
--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=saurav.girepunje@hotmail.com \
--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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.