提交 5e37141b 编写于 作者: V Vincent Palatin 提交者: Andrzej Zaborowski

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: NVincent Palatin <vpalatin@chromium.org>
Signed-off-by: NAndrzej Zaborowski <andrew.zaborowski@intel.com>
上级 4b5dfd82
......@@ -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;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册