Skip to content

Commit

Permalink
[SCSI] fix sg leak when scsi_execute_async fails
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Mike Christie authored and James Bottomley committed Apr 13, 2006
1 parent 21b2f0c commit 18c49b8
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions drivers/scsi/sg.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 18c49b8

Please sign in to comment.