All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] fix sg leak when scsi_execute_async fails
@ 2006-03-22 22:04 Mike Christie
  2006-03-22 23:10 ` Douglas Gilbert
  0 siblings, 1 reply; 2+ messages in thread
From: Mike Christie @ 2006-03-22 22:04 UTC (permalink / raw)
  To: dougg, linux-scsi

Doug found a bug where if scsi_execute_async fails, we are leaking
sg resources. scsi_do_req never failed so we did not have to handle
that case before.

Patch was made against scsi-misc. Not sure if this should
also go to stable?

Signed-off-by: Mike Christie <michaelc@cs.wisc.edu>



diff --git a/drivers/scsi/sg.c b/drivers/scsi/sg.c
index a8b05ce..71994ea 100644
--- a/drivers/scsi/sg.c
+++ b/drivers/scsi/sg.c
@@ -748,6 +748,7 @@ sg_common_write(Sg_fd * sfp, Sg_request 
 		/*
 		 * most likely out of mem, but could also be a bad map
 		 */
+		sg_finish_rem_req(srp);
 		return -ENOMEM;
 	} else
 		return 0;



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

end of thread, other threads:[~2006-03-22 23:11 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-03-22 22:04 [PATCH] fix sg leak when scsi_execute_async fails Mike Christie
2006-03-22 23:10 ` Douglas Gilbert

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.