diff mbox

[10/14] scsi: Fix data length == SCSI_SENSE_BUF_SIZE

Message ID 1341222087-24920-11-git-send-email-pbonzini@redhat.com
State New
Headers show

Commit Message

Paolo Bonzini July 2, 2012, 9:41 a.m. UTC
From: Christian Hoff <christian.hoff@de.ibm.com>

Fix the edge case where the sense data length is exactly the same
as SCSI_SENSE_BUF_SIZE.
This makes SCSI requests work that use all of the available 95 byte
sense data.

Signed-off-by: Christian Hoff <christian.hoff@de.ibm.com>
Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 hw/scsi-bus.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox

Patch

diff --git a/hw/scsi-bus.c b/hw/scsi-bus.c
index 14e2f73..4e95eee 100644
--- a/hw/scsi-bus.c
+++ b/hw/scsi-bus.c
@@ -1389,7 +1389,7 @@  void scsi_req_complete(SCSIRequest *req, int status)
     assert(req->status == -1);
     req->status = status;
 
-    assert(req->sense_len < sizeof(req->sense));
+    assert(req->sense_len <= sizeof(req->sense));
     if (status == GOOD) {
         req->sense_len = 0;
     }