qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] scsi-generic: Remove bogus double complete
@ 2011-04-05  5:07 David Gibson
  2011-04-05 14:00 ` Kevin Wolf
  0 siblings, 1 reply; 3+ messages in thread
From: David Gibson @ 2011-04-05  5:07 UTC (permalink / raw)
  To: qemu-devel

From: Ben Herrenschmidt <benh@kernel.crashing.org>

scsi-generic scsi_read_complete() should not -both- call the client
complete callback with SCSI_REASON_DATA -and- call
scsi_command_complete().  The former will cause the client to queue a
new read or write request, while the later will free the request data
structure, thus causing the new read or write request to use a
freed/stale structure when it completes.

This patch fixes the bug, fixing a crash with scsi-generic & RHEL5.5
installer.

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
---
 hw/scsi-generic.c |    2 --
 1 files changed, 0 insertions(+), 2 deletions(-)

diff --git a/hw/scsi-generic.c b/hw/scsi-generic.c
index 9be1cca..c06f5df 100644
--- a/hw/scsi-generic.c
+++ b/hw/scsi-generic.c
@@ -173,8 +173,6 @@ static void scsi_read_complete(void * opaque, int ret)
 
     r->len = -1;
     r->req.bus->complete(r->req.bus, SCSI_REASON_DATA, r->req.tag, len);
-    if (len == 0)
-        scsi_command_complete(r, 0);
 }
 
 /* Read more data from scsi device into buffer.  */
-- 
1.7.1

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2011-05-03 12:14 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-04-05  5:07 [Qemu-devel] [PATCH] scsi-generic: Remove bogus double complete David Gibson
2011-04-05 14:00 ` Kevin Wolf
2011-05-03 12:14   ` Paolo Bonzini

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).