[Spice-devel] [PATCH spice-gtk 28/44] fixup! usb-redir: add files for SCSI and USB MSC implementation

Frediano Ziglio fziglio at redhat.com
Tue Jul 30 12:03:16 UTC 2019


Use sizeof instead of constant.
---
 src/cd-usb-bulk-msd.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/cd-usb-bulk-msd.c b/src/cd-usb-bulk-msd.c
index 61c15a75..ab6644f3 100644
--- a/src/cd-usb-bulk-msd.c
+++ b/src/cd-usb-bulk-msd.c
@@ -264,7 +264,7 @@ static int parse_usb_msd_cmd(UsbCdBulkMsdDevice *cd, uint8_t *buf, uint32_t cbw_
     UsbCdBulkMsdRequest *usb_req = &cd->usb_req;
     CdScsiRequest *scsi_req = &usb_req->scsi_req;
 
-    if (cbw_len != 31) {
+    if (cbw_len != sizeof(*cbw)) {
         SPICE_ERROR("CMD: Bad CBW size:%" G_GUINT32_FORMAT, cbw_len);
         return -1;
     }
-- 
2.20.1



More information about the Spice-devel mailing list