[SCSI] fix sg leak when scsi_execute_async fails
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.
Signed-off-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
diff --git a/drivers/scsi/sg.c b/drivers/scsi/sg.c
index fcf9243..bfa86b3 100644
--- a/drivers/scsi/sg.c
+++ b/drivers/scsi/sg.c
@@ -748,6 +748,7 @@
/*
* most likely out of mem, but could also be a bad map
*/
+ sg_finish_rem_req(srp);
return -ENOMEM;
} else
return 0;