[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>
This commit is contained in:
Mike Christie 2006-03-22 16:04:38 -06:00 коммит произвёл James Bottomley
Родитель 21b2f0c803
Коммит 18c49b8cd6
1 изменённых файлов: 1 добавлений и 0 удалений

Просмотреть файл

@ -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;