Skip to contentSkip to conversation

fix accidental erase of OneNand whole chip

PATCH New Geiger Ho 2 participants 2 messages May 18, 2009 – May 19, 2009

lore
Share & tools
lore

Geiger Ho

author
#0 lore raw

PATCH 1/1 fix accidental erase of OneNand whole chip

This patch fixes the accidental erase of OneNand whole chip when issuing command "onenand erase".

--- u-boot-2009.03/common/cmd_onenand.c 2009-03-22 05:04:41.000000000 +0800
+++ u-boot-2009.03-dev/common/cmd_onenand.c 2009-05-18
17:57:27.000000000 +0800
@@ -367,6 +367,8 @@ int do_onenand(cmd_tbl_t * cmdtp, int fl
return 0;
}

+ goto usage;
+
default:
/* At least 4 args */

#1 lore raw

PATCH 1/1 fix accidental erase of OneNand whole chip

Quoted 10 lines · Geiger Ho

This patch fixes the accidental erase of OneNand whole chip when issuing command "onenand erase".

common/cmd_onenand.c +0 -0

17:57:27.000000000 +0800

common/cmd_onenand.c int do_onenand(cmd_tbl_t * cmdtp, int fl · line 374

Quoted 8 lines
common/cmd_onenand.c +2 -0
@@ -367,6 +367,8 @@ int do_onenand(cmd_tbl_t * cmdtp, int fl
  			return 0;
  		}
 
+		goto usage;
+
  	default:
  		/* At least 4 args */
 

While that "at least 4 args" comment seems wrong, I don't think this patch is correct -- there is code in the default block that checks argc and expects to get there with argc == 2 in some cases.

How does accidental erasing occur?

-Scott