diff options
author | BALATON Zoltan | 2019-01-09 23:37:33 +0100 |
---|---|---|
committer | David Gibson | 2019-02-04 08:44:17 +0100 |
commit | 4f10ed277da91b2cb1b6e8a2de18792ce7881832 (patch) | |
tree | dc0aea6c35f19c8039b171951d0e480c56c2c716 /hw | |
parent | target/ppc/kvm: Drop useless include directive (diff) | |
download | qemu-4f10ed277da91b2cb1b6e8a2de18792ce7881832.tar.gz qemu-4f10ed277da91b2cb1b6e8a2de18792ce7881832.tar.xz qemu-4f10ed277da91b2cb1b6e8a2de18792ce7881832.zip |
ppc440: Avoid reporting error when reading non-existent RAM slot
When reading base register of RAM slot with no RAM we should not try
to calculate register value because that will result printing an error
due to invalid RAM size. Just return 0 without the error in this case.
Signed-off-by: BALATON Zoltan <balaton@eik.bme.hu>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Diffstat (limited to 'hw')
-rw-r--r-- | hw/ppc/ppc440_uc.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/hw/ppc/ppc440_uc.c b/hw/ppc/ppc440_uc.c index c489368905..9130eb314c 100644 --- a/hw/ppc/ppc440_uc.c +++ b/hw/ppc/ppc440_uc.c @@ -613,8 +613,10 @@ static uint32_t dcr_read_sdram(void *opaque, int dcrn) case SDRAM_R1BAS: case SDRAM_R2BAS: case SDRAM_R3BAS: - ret = sdram_bcr(sdram->ram_bases[dcrn - SDRAM_R0BAS], - sdram->ram_sizes[dcrn - SDRAM_R0BAS]); + if (sdram->ram_sizes[dcrn - SDRAM_R0BAS]) { + ret = sdram_bcr(sdram->ram_bases[dcrn - SDRAM_R0BAS], + sdram->ram_sizes[dcrn - SDRAM_R0BAS]); + } break; case SDRAM_CONF1HB: case SDRAM_CONF1LL: |