[U-Boot] [PATCH 1/1] Bug fix - release env memory.

This is my first time to create a patch. Not sure if I have done it right.
Signed-off-by: Derek Ou derek@siconix.com --- common/env_nand.c | 4 ++++ 1 files changed, 4 insertions(+), 0 deletions(-)
diff --git a/common/env_nand.c b/common/env_nand.c index 8af9e74..01430cb 100644 --- a/common/env_nand.c +++ b/common/env_nand.c @@ -305,7 +305,11 @@ void env_relocate_spec (void) crc2_ok = (crc32(0, tmp_env2->data, ENV_SIZE) == tmp_env2->crc);
if(!crc1_ok && !crc2_ok) + { + free(tmp_env1); + free(tmp_env2); return use_default(); + } else if(crc1_ok && !crc2_ok) gd->env_valid = 1; else if(!crc1_ok && crc2_ok)

On Jan 26, 2009, at 11:50 AM, derek@siconix.com wrote:
Looks ok, but
This is my first time to create a patch. Not sure if I have done it right.
we normally put a description of the fix, issue, etc in this section. (as its the commit message).
Signed-off-by: Derek Ou derek@siconix.com
common/env_nand.c | 4 ++++ 1 files changed, 4 insertions(+), 0 deletions(-)
- k

Dear Derek,
In message 0bee6c3501ae7b8e2c111bf32219e501.squirrel@webmail.siconix.com you wrote:
This is my first time to create a patch. Not sure if I have done it right.
Close, but no cigar ;-)
A comment like the line above must go below the "---" line.
Signed-off-by: Derek Ou derek@siconix.com
^^^^^^^^^^^^---- add comments that are not supposed to become art of the commit message only *after* this line.
common/env_nand.c | 4 ++++ 1 files changed, 4 insertions(+), 0 deletions(-)
diff --git a/common/env_nand.c b/common/env_nand.c index 8af9e74..01430cb 100644 --- a/common/env_nand.c +++ b/common/env_nand.c @@ -305,7 +305,11 @@ void env_relocate_spec (void) crc2_ok = (crc32(0, tmp_env2->data, ENV_SIZE) == tmp_env2->crc);
if(!crc1_ok && !crc2_ok)
- {
Please put the "{" on the same line with the "if" (see CodingStyle).
free(tmp_env1);
return use_default();free(tmp_env2);
- } else if(crc1_ok && !crc2_ok)
And the "}" will go on the same line with the "else", too.
gd->env_valid = 1;
else if(!crc1_ok && crc2_ok)
Please fix and resubmit.
Best regards,
Wolfgang Denk
participants (3)
-
derek@siconix.com
-
Kumar Gala
-
Wolfgang Denk