All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Philippe Mathieu-Daudé" <philmd@redhat.com>
To: qemu-devel@nongnu.org
Cc: "Philippe Mathieu-Daudé" <philmd@redhat.com>, qemu-block@nongnu.org
Subject: [PATCH v3 08/11] hw/sd/sdcard: Make iolen unsigned
Date: Fri,  5 Jun 2020 12:22:27 +0200	[thread overview]
Message-ID: <20200605102230.21493-9-philmd@redhat.com> (raw)
In-Reply-To: <20200605102230.21493-1-philmd@redhat.com>

I/O request length can not be negative.

Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
---
 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 9d51138b11..952be36399 100644
--- a/hw/sd/sd.c
+++ b/hw/sd/sd.c
@@ -1950,7 +1950,7 @@ uint8_t sd_read_data(SDState *sd)
 {
     /* TODO: Append CRCs */
     uint8_t ret;
-    int io_len;
+    size_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..f892c05867 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, size_t length) "%s %20s/ CMD%02d len %zu"
 sdcard_set_voltage(uint16_t millivolts) "%u mV"
 
 # milkymist-memcard.c
-- 
2.21.3



  parent reply	other threads:[~2020-06-05 10:27 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-05 10:22 [PATCH v3 00/11] hw/sd/sdcard: Fix CVE-2020-13253 & cleanups Philippe Mathieu-Daudé
2020-06-05 10:22 ` [PATCH v3 01/11] MAINTAINERS: Cc qemu-block mailing list Philippe Mathieu-Daudé
2020-06-05 10:22 ` [PATCH v3 02/11] hw/sd/sdcard: Update coding style to make checkpatch.pl happy Philippe Mathieu-Daudé
2020-06-15 13:30   ` Peter Maydell
2020-06-05 10:22 ` [PATCH v3 03/11] hw/sd/sdcard: Do not switch to ReceivingData if address is invalid Philippe Mathieu-Daudé
2020-06-15 14:06   ` Peter Maydell
2020-07-13 16:36     ` Philippe Mathieu-Daudé
2020-07-13 16:49       ` Philippe Mathieu-Daudé
2020-06-05 10:22 ` [PATCH v3 04/11] hw/sd/sdcard: Restrict Class 6 commands to SCSD cards Philippe Mathieu-Daudé
2020-06-15 13:28   ` Peter Maydell
2020-06-05 10:22 ` [PATCH v3 05/11] hw/sd/sdcard: Update the SDState documentation Philippe Mathieu-Daudé
2020-06-15 14:07   ` Peter Maydell
2020-06-05 10:22 ` [PATCH v3 06/11] hw/sd/sdcard: Simplify cmd_valid_while_locked() Philippe Mathieu-Daudé
2020-06-15 14:08   ` Peter Maydell
2020-06-05 10:22 ` [PATCH v3 07/11] hw/sd/sdcard: Constify sd_crc*()'s message argument Philippe Mathieu-Daudé
2020-06-05 10:22 ` Philippe Mathieu-Daudé [this message]
2020-06-15 14:13   ` [PATCH v3 08/11] hw/sd/sdcard: Make iolen unsigned Peter Maydell
2020-06-05 10:22 ` [PATCH v3 09/11] hw/sd/sdcard: Correctly display the command name in trace events Philippe Mathieu-Daudé
2020-06-15 14:20   ` Peter Maydell
2020-06-05 10:22 ` [PATCH v3 10/11] hw/sd/sdcard: Display offset in read/write_data() " Philippe Mathieu-Daudé
2020-06-15 14:21   ` Peter Maydell
2020-06-05 10:22 ` [PATCH v3 11/11] hw/sd/sdcard: Simplify realize() a bit Philippe Mathieu-Daudé
2020-06-15 14:24   ` Peter Maydell
2020-06-08 17:48 ` [PATCH v3 00/11] hw/sd/sdcard: Fix CVE-2020-13253 & cleanups Philippe Mathieu-Daudé
2020-07-06 16:31   ` Alistair Francis
2020-07-06 18:01     ` Philippe Mathieu-Daudé
2020-06-15  7:33 ` Philippe Mathieu-Daudé

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200605102230.21493-9-philmd@redhat.com \
    --to=philmd@redhat.com \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.