Commit 7317b8cad72b39bf06d1ce76e20a92c7ef157ba6
1 parent
9596ebb7
Fix a && -> & typo.
Catch wrong/unknown NOR flash command sequences, by Thorsten Zitterell. git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3684 c046a42c-6fe2-441c-8c8c-71466251a162
Showing
2 changed files
with
7 additions
and
2 deletions
hw/pflash_cfi01.c
... | ... | @@ -353,6 +353,8 @@ static void pflash_write (pflash_t *pfl, target_ulong offset, uint32_t value, |
353 | 353 | |
354 | 354 | pfl->counter--; |
355 | 355 | break; |
356 | + default: | |
357 | + goto error_flash; | |
356 | 358 | } |
357 | 359 | return; |
358 | 360 | case 3: /* Confirm mode */ |
... | ... | @@ -361,11 +363,14 @@ static void pflash_write (pflash_t *pfl, target_ulong offset, uint32_t value, |
361 | 363 | if (cmd == 0xd0) { |
362 | 364 | pfl->wcycle = 0; |
363 | 365 | pfl->status |= 0x80; |
364 | - break; | |
365 | 366 | } else { |
366 | 367 | DPRINTF("%s: unknown command for \"write block\"\n", __func__); |
367 | 368 | PFLASH_BUG("Write block confirm"); |
369 | + goto reset_flash; | |
368 | 370 | } |
371 | + break; | |
372 | + default: | |
373 | + goto error_flash; | |
369 | 374 | } |
370 | 375 | return; |
371 | 376 | default: |
... | ... |
vl.c
... | ... | @@ -8269,7 +8269,7 @@ int main(int argc, char **argv) |
8269 | 8269 | kqemu_allowed = 0; |
8270 | 8270 | #endif |
8271 | 8271 | linux_boot = (kernel_filename != NULL); |
8272 | - net_boot = (boot_devices_bitmap >> ('n' - 'a')) && 0xF; | |
8272 | + net_boot = (boot_devices_bitmap >> ('n' - 'a')) & 0xF; | |
8273 | 8273 | |
8274 | 8274 | /* XXX: this should not be: some embedded targets just have flash */ |
8275 | 8275 | if (!linux_boot && net_boot == 0 && |
... | ... |