Skip to content
Snippets Groups Projects
Commit 5e37141b authored by Vincent Palatin's avatar Vincent Palatin Committed by Andrzej Zaborowski
Browse files

sd: do not add one sector to the disk size


This leads to random off-by-one error.
When the size of the SD is exactly 1GB, the emulation was returning a
wrong SDHC CSD descriptor.

Signed-off-by: default avatarVincent Palatin <vpalatin@chromium.org>
Signed-off-by: default avatarAndrzej Zaborowski <andrew.zaborowski@intel.com>
parent 4b5dfd82
No related branches found
No related tags found
No related merge requests found
......@@ -393,9 +393,7 @@ static void sd_reset(SDState *sd, BlockDriverState *bdrv)
} else {
sect = 0;
}
sect <<= 9;
size = sect + 1;
size = sect << 9;
sect = (size >> (HWBLOCK_SHIFT + SECTOR_SHIFT + WPGROUP_SHIFT)) + 1;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment