[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v4 11/14] hw/sd/sdcard: Make iolen unsigned
From: |
Philippe Mathieu-Daudé |
Subject: |
[PATCH v4 11/14] hw/sd/sdcard: Make iolen unsigned |
Date: |
Fri, 26 Jun 2020 18:28:15 +0200 |
From: Philippe Mathieu-Daudé <philmd@redhat.com>
I/O request length can not be negative.
Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
---
v4: Use uint32_t (pm215)
---
hw/sd/sd.c | 2 +-
hw/sd/trace-events | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/hw/sd/sd.c b/hw/sd/sd.c
index a0500f4551..8dd83c365c 100644
--- a/hw/sd/sd.c
+++ b/hw/sd/sd.c
@@ -1967,7 +1967,7 @@ uint8_t sd_read_data(SDState *sd)
{
/* TODO: Append CRCs */
uint8_t ret;
- int io_len;
+ uint32_t io_len;
if (!sd->blk || !blk_is_inserted(sd->blk) || !sd->enable)
return 0x00;
diff --git a/hw/sd/trace-events b/hw/sd/trace-events
index 5f09d32eb2..d0cd7c6ec4 100644
--- a/hw/sd/trace-events
+++ b/hw/sd/trace-events
@@ -52,7 +52,7 @@ sdcard_unlock(void) ""
sdcard_read_block(uint64_t addr, uint32_t len) "addr 0x%" PRIx64 " size 0x%x"
sdcard_write_block(uint64_t addr, uint32_t len) "addr 0x%" PRIx64 " size 0x%x"
sdcard_write_data(const char *proto, const char *cmd_desc, uint8_t cmd,
uint8_t value) "%s %20s/ CMD%02d value 0x%02x"
-sdcard_read_data(const char *proto, const char *cmd_desc, uint8_t cmd, int
length) "%s %20s/ CMD%02d len %d"
+sdcard_read_data(const char *proto, const char *cmd_desc, uint8_t cmd,
uint32_t length) "%s %20s/ CMD%02d len %" PRIu32
sdcard_set_voltage(uint16_t millivolts) "%u mV"
# milkymist-memcard.c
--
2.21.3
- [PATCH v4 03/14] hw/sd/sdcard: Move some definitions to use them earlier, (continued)
- [PATCH v4 03/14] hw/sd/sdcard: Move some definitions to use them earlier, Philippe Mathieu-Daudé, 2020/06/26
- [PATCH v4 04/14] hw/sd/sdcard: Use the HWBLOCK_SIZE definition, Philippe Mathieu-Daudé, 2020/06/26
- [PATCH v4 05/14] hw/sd/sdcard: Do not switch to ReceivingData if address is invalid, Philippe Mathieu-Daudé, 2020/06/26
- [PATCH v4 06/14] hw/sd/sdcard: Restrict Class 6 commands to SCSD cards, Philippe Mathieu-Daudé, 2020/06/26
- [PATCH v4 07/14] hw/sd/sdcard: Check address is in range, Philippe Mathieu-Daudé, 2020/06/26
- [PATCH v4 08/14] hw/sd/sdcard: Update the SDState documentation, Philippe Mathieu-Daudé, 2020/06/26
- [PATCH v4 09/14] hw/sd/sdcard: Simplify cmd_valid_while_locked(), Philippe Mathieu-Daudé, 2020/06/26
- [PATCH v4 10/14] hw/sd/sdcard: Constify sd_crc*()'s message argument, Philippe Mathieu-Daudé, 2020/06/26
- [PATCH v4 12/14] hw/sd/sdcard: Correctly display the command name in trace events, Philippe Mathieu-Daudé, 2020/06/26
- [PATCH v4 13/14] hw/sd/sdcard: Display offset in read/write_data() trace events, Philippe Mathieu-Daudé, 2020/06/26
- [PATCH v4 11/14] hw/sd/sdcard: Make iolen unsigned,
Philippe Mathieu-Daudé <=
- [PATCH v4 14/14] hw/sd/sdcard: Simplify realize() a bit, Philippe Mathieu-Daudé, 2020/06/26
- Re: [PATCH v4 00/14] hw/sd/sdcard: Fix CVE-2020-13253 & cleanups, Philippe Mathieu-Daudé, 2020/06/26
- Re: [PATCH v4 00/14] hw/sd/sdcard: Fix CVE-2020-13253 & cleanups, no-reply, 2020/06/26
- Re: [PATCH v4 00/14] hw/sd/sdcard: Fix CVE-2020-13253 & cleanups, no-reply, 2020/06/26