summaryrefslogtreecommitdiffstats
path: root/common/cmd_itest.c
diff options
context:
space:
mode:
authorStephen Warren <swarren@nvidia.com>2015-11-17 10:29:08 -0700
committerTom Rini <trini@konsulko.com>2015-11-18 15:29:00 -0500
commit736d1746fb7b8f7cd70657a4a72db2b6bd8de40e (patch)
tree61aaeb0fdbc07508fd5a6c0eb475e4f2d12444b8 /common/cmd_itest.c
parent34a60d9bc88b6b009da6f7ef4d8b70f807eaada4 (diff)
downloadu-boot-736d1746fb7b8f7cd70657a4a72db2b6bd8de40e.tar.gz
u-boot-736d1746fb7b8f7cd70657a4a72db2b6bd8de40e.tar.xz
u-boot-736d1746fb7b8f7cd70657a4a72db2b6bd8de40e.zip
itest: add missing break statements to evalexp()
The commit mentioned below replaced return statements inside a switch so that other code could be called after the switch. However, it didn't add any break statements, causing the cases to run together. Fix this. Reported-by: Coverity (CID 132282, 132283) Fixes: 7861204c9af7 ("itest: make memory access work under sandbox") Signed-off-by: Stephen Warren <swarren@nvidia.com>
Diffstat (limited to 'common/cmd_itest.c')
-rw-r--r--common/cmd_itest.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/common/cmd_itest.c b/common/cmd_itest.c
index 596341c963..91ae5c2704 100644
--- a/common/cmd_itest.c
+++ b/common/cmd_itest.c
@@ -64,9 +64,15 @@ static long evalexp(char *s, int w)
return 0;
}
switch (w) {
- case 1: l = (long)(*(unsigned char *)buf);
- case 2: l = (long)(*(unsigned short *)buf);
- case 4: l = (long)(*(unsigned long *)buf);
+ case 1:
+ l = (long)(*(unsigned char *)buf);
+ break;
+ case 2:
+ l = (long)(*(unsigned short *)buf);
+ break;
+ case 4:
+ l = (long)(*(unsigned long *)buf);
+ break;
}
unmap_physmem(buf, w);
return l;