Skip to content

Commit

Permalink
[SCSI] tgt: fix warning
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Joe Eykholt authored and James Bottomley committed Aug 11, 2010
1 parent 081f4f4 commit 3deee42
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions drivers/scsi/scsi_tgt_lib.c
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,7 @@ static void scsi_tgt_cmd_destroy(struct work_struct *work)
dprintk("cmd %p %d %u\n", cmd, cmd->sc_data_direction,
rq_data_dir(cmd->request));
scsi_unmap_user_pages(tcmd);
tcmd->rq->bio = NULL;
scsi_host_put_command(scsi_tgt_cmd_to_host(cmd), cmd);
}

Expand Down

0 comments on commit 3deee42

Please sign in to comment.