mtd: devices: phram.c: Fix multiple kfree statement from phram_setup
Subsystems (2)
PATCH 1/1 mtd: devices: phram.c: Fix multiple kfree statement from phram_setup
Remove multiple kfree statement from phram_setup() in phram.c
---
Change in v1:
- Add change suggested by Miquel Raynal <[email protected]> "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(-)
drivers/mtd/devices/phram.c +4 -4
@@ -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; }
Signature · 1 line
2.20.1
Miquel Raynal
maintainerSaurav,
Saurav Girepunje <[email protected]> wrote on Tue, 29 Oct 2019 22:38:49 +0530:
Are you a robot?
Quoted 1 line
Remove multiple kfree statement from
phram_setup()inphram.c
This does not describe what you are doing, you don't remove them you factorize them. And honestly I am not convinced this change is useful in old code.
Quoted 5 lines
Signed-off-by Saurav Girepunje <[email protected]>---
Change in v1:
Your first version is v1, how can you be at v1? It is almost v3 already!
Quoted 4 lines
- Add change suggested by Miquel Raynal <[email protected]> "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."
This is a copy/paste of what I have said. What I want you to write is:
"
- Rename the goto statement to describe bla bla bla.
- Fix the typo in the goto label.
"
Quoted 9 lines
drivers/mtd/devices/phram.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)drivers/mtd/devices/phram.c +0
-0
drivers/mtd/devices/phram.c static int phram_setup(const char *val) · line 247
Quoted 6 lines
drivers/mtd/devices/phram.c +1
-1@@ -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;
Come one...
Thanks,
Miquèl
A message that is not in the archive (sent off-list or not yet received): CAEZuxTSjS=0CP0+tJOst23pX+-g1cXoDcX1Jemz+8s4NTokKUg@mail.gmail.com
Miquel Raynal
maintainerHi Saurav,
Saurav Girepunje <[email protected]> wrote on Wed, 30 Oct 2019 16:57:06 +0530:
Quoted 6 lines
Are you a robot?
NoThanks for you input. Will dorp this patch if you are not convinced for changes.
Quoted 6 lines
Due to your suggestions only I learned how to add version and change log in patch file. However I did mistake in this patch version and change log but I learned about it.Before sending this I was totally unaware about these things.
Thanks again for your help....
Ok then please have a look at this, first:
https://elixir.bootlin.com/linux/latest/source/Documentation/process/submitting-patches.rst
And please make sure you address the comments. I told you to fix a typo, you added it in your changelog but you forgot to actually do the change. Please do not hurry when you want to submit changes and reread them before actually sending them.
Quoted 56 lines
Quoted 52 lines · Miquel Raynal,
Saurav,
Saurav Girepunje <[email protected]> wrote on Tue, 29 Oct 2019 22:38:49 +0530:
Are you a robot?
Quoted 1 line
Remove multiple kfree statement from
phram_setup()inphram.cThis does not describe what you are doing, you don't remove them you factorize them. And honestly I am not convinced this change is useful in old code.
Quoted 5 lines
Signed-off-by Saurav Girepunje <[email protected]>---
Change in v1:
Your first version is v1, how can you be at v1? It is almost v3 already!
Quoted 4 lines
- Add change suggested by Miquel Raynal <[email protected]> "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."This is a copy/paste of what I have said. What I want you to write is:
"
- Rename the goto statement to describe bla bla bla.
- Fix the typo in the goto label.
"Quoted 9 lines
drivers/mtd/devices/phram.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)drivers/mtd/devices/phram.c +0
-0drivers/mtd/devices/phram.c static int phram_setup(const char *val) · line 247
Quoted 6 lines
drivers/mtd/devices/phram.c +1
-1@@ -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;Come one...
Quoted 3 lines
Quoted 3 lines
Thanks,
Miquèl
Thanks,
Miquèl
______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/