diff options
author | Joe Eykholt <jeykholt@cisco.com> | 2010-08-05 20:50:37 -0400 |
---|---|---|
committer | James Bottomley <James.Bottomley@suse.de> | 2010-08-11 00:55:42 -0400 |
commit | 3deee42088ddcf5b23021aa089b53444797e565d (patch) | |
tree | 7b4fbd6d608eb8a677b745a8bf36b5540751a7f3 | |
parent | 081f4f4c1ae9915398b3f8ffc9307e5adaf62989 (diff) |
[SCSI] tgt: fix warning
Using scsi_tgt_lib in a new target module, we were getting
the following warning and a stack traceback on every I/O completion:
WARNING: at block/blk-core.c:1108
Which is claiming we may be leaking a bio.
We don't leak bios (blk_rq_unmap_user should free them).
Set rq->bio to NULL before calling scsi_host_put_command().
This was as advised by Fujita Tomonori.
Signed-off-by: Joe Eykholt <jeykholt@cisco.com>
Acked-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
-rw-r--r-- | drivers/scsi/scsi_tgt_lib.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/scsi/scsi_tgt_lib.c b/drivers/scsi/scsi_tgt_lib.c index 66241dd525ae..c399be979921 100644 --- a/drivers/scsi/scsi_tgt_lib.c +++ b/drivers/scsi/scsi_tgt_lib.c | |||
@@ -185,6 +185,7 @@ static void scsi_tgt_cmd_destroy(struct work_struct *work) | |||
185 | dprintk("cmd %p %d %u\n", cmd, cmd->sc_data_direction, | 185 | dprintk("cmd %p %d %u\n", cmd, cmd->sc_data_direction, |
186 | rq_data_dir(cmd->request)); | 186 | rq_data_dir(cmd->request)); |
187 | scsi_unmap_user_pages(tcmd); | 187 | scsi_unmap_user_pages(tcmd); |
188 | tcmd->rq->bio = NULL; | ||
188 | scsi_host_put_command(scsi_tgt_cmd_to_host(cmd), cmd); | 189 | scsi_host_put_command(scsi_tgt_cmd_to_host(cmd), cmd); |
189 | } | 190 | } |
190 | 191 | ||