Skip to contentSkip to conversation

hw/omap_gpmc.c: Add missing 'break's to fix 8 bit NAND writes

PATCH Applied Peter Maydell 2 participants 2 messages Nov 9, 2011

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 hw/omap_gpmc.c: Add missing 'break's to fix 8 bit NAND writes

Add missing 'break' statements which would have meant that writing to an 8 bit NAND device was broken. Spotted by Coverity (see bug 887883).

---
This is an embarrassing bug...

 hw/omap_gpmc.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
hw/omap_gpmc.c +2 -0
index 7fc82a2..414f9f5 100644
@@ -180,6 +180,7 @@ static void omap_nand_setio(DeviceState *dev, uint64_t value,
             nand_setio(dev, (value >> 24) & 0xff);
             break;
         }
+        break;
     case OMAP_GPMC_16BIT:
         switch (size) {
         case 1:
@@ -195,6 +196,7 @@ static void omap_nand_setio(DeviceState *dev, uint64_t value,
             nand_setio(dev, (value >> 16) & 0xffff);
             break;
         }
+        break;
     }
 }
 
Signature · 1 line
1.7.1
#1 lore raw
Quoted 5 lines · Peter Maydell

Add missing 'break' statements which would have meant that writing to an 8 bit NAND device was broken. Spotted by Coverity (see bug 887883).

Applied. Thanks.

Regards,

Anthony Liguori

Quoted 26 lines

---
This is an embarrassing bug...

  hw/omap_gpmc.c |    2 ++
  1 files changed, 2 insertions(+), 0 deletions(-)
hw/omap_gpmc.c +2 -0
index 7fc82a2..414f9f5 100644
@@ -180,6 +180,7 @@ static void omap_nand_setio(DeviceState *dev, uint64_t value,
              nand_setio(dev, (value>>  24)&  0xff);
              break;
          }
+        break;
      case OMAP_GPMC_16BIT:
          switch (size) {
          case 1:
@@ -195,6 +196,7 @@ static void omap_nand_setio(DeviceState *dev, uint64_t value,
              nand_setio(dev, (value>>  16)&  0xffff);
              break;
          }
+        break;
      }
  }