From: Mike Christie Date: Wed, 22 Mar 2006 22:04:38 +0000 (-0600) Subject: [SCSI] fix sg leak when scsi_execute_async fails X-Git-Tag: v2.6.17-rc2~30^2~43 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=18c49b8cd69c360735df2cc6eeeb2593c01a81e8;p=karo-tx-linux.git [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 Signed-off-by: James Bottomley --- diff --git a/drivers/scsi/sg.c b/drivers/scsi/sg.c index fcf9243dfa7d..bfa86b378fb9 100644 --- a/drivers/scsi/sg.c +++ b/drivers/scsi/sg.c @@ -748,6 +748,7 @@ sg_common_write(Sg_fd * sfp, Sg_request * srp, /* * most likely out of mem, but could also be a bad map */ + sg_finish_rem_req(srp); return -ENOMEM; } else return 0;