瀏覽代碼

[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>
Mike Christie 19 年之前
父節點
當前提交
18c49b8cd6
共有 1 個文件被更改,包括 1 次插入0 次删除
  1. 1 0
      drivers/scsi/sg.c

+ 1 - 0
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
 		 * most likely out of mem, but could also be a bad map
 		 */
 		 */
+		sg_finish_rem_req(srp);
 		return -ENOMEM;
 		return -ENOMEM;
 	} else
 	} else
 		return 0;
 		return 0;