[PATCH] tgt: fix warning

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxx>
Acked-by: FUJITA Tomonori <fujita.tomonori@xxxxxxxxxxxxx>
---
 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 66241dd..c399be9 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)
 	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);
 }
 


--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [SCSI Target Devel]     [Linux SCSI Target Infrastructure]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Samba]     [Device Mapper]
  Powered by Linux