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

login
register
mail settings
Submitter Peter Maydell
Date Nov. 9, 2011, 5:42 p.m.
Message ID <1320860543-9596-1-git-send-email-peter.maydell@linaro.org>
Download mbox | patch
Permalink /patch/124638/
State New
Headers show

Comments

Peter Maydell - Nov. 9, 2011, 5:42 p.m.
Add missing 'break' statements which would have meant that writing
to an 8 bit NAND device was broken. Spotted by Coverity (see bug
887883).

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
---
This is an embarrassing bug...

 hw/omap_gpmc.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
Anthony Liguori - Nov. 9, 2011, 7:45 p.m.
On 11/09/2011 11:42 AM, Peter Maydell wrote:
> Add missing 'break' statements which would have meant that writing
> to an 8 bit NAND device was broken. Spotted by Coverity (see bug
> 887883).
>
> Signed-off-by: Peter Maydell<peter.maydell@linaro.org>

Applied.  Thanks.

Regards,

Anthony Liguori

> ---
> This is an embarrassing bug...
>
>   hw/omap_gpmc.c |    2 ++
>   1 files changed, 2 insertions(+), 0 deletions(-)
>
> diff --git a/hw/omap_gpmc.c b/hw/omap_gpmc.c
> index 7fc82a2..414f9f5 100644
> --- a/hw/omap_gpmc.c
> +++ b/hw/omap_gpmc.c
> @@ -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;
>       }
>   }
>

Patch

diff --git a/hw/omap_gpmc.c b/hw/omap_gpmc.c
index 7fc82a2..414f9f5 100644
--- a/hw/omap_gpmc.c
+++ b/hw/omap_gpmc.c
@@ -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;
     }
 }