nvme_fc: avoid double kfree(), don't call nvme_cleanup_cmd() in nvme_unmap_data()
Subsystems (2)
PATCH 1/1 nvme_fc: avoid double kfree(), don't call nvme_cleanup_cmd() in nvme_unmap_data()
nvme_cleanup_cmd() is already called by callers of nvme_unmap_data(). Don't call it twice to avoid double-free on completion of discard commands.
Signed-off-by Ewan D. Milne <emilne at redhat.com>
--- drivers/nvme/host/fc.c | 2 -- 1 files changed, 0 insertions(+), 2 deletions(-)
drivers/nvme/host/fc.c +0 -2
@@ -1700,8 +1700,6 @@ enum blk_eh_timer_return ((rq_data_dir (rq) ==WRITE ) ? DMA_TO_DEVICE : DMA_FROM_DEVICE)); -nvme_cleanup_cmd (rq); -sg_free_table_chained (&freq->sg_table, true); freq->sg_cnt =0 ;
Signature · 1 line
1.7.1
PATCH 1/1 nvme_fc: avoid double kfree(), don't call nvme_cleanup_cmd() in nvme_unmap_data()
Hi Ewan,
Quoted 1 line · Ewan Milne
nvme_cleanup_cmd()is already called by callers ofnvme_unmap_data().
nvme_fc_unmap_data()? ^
And besides this, in nvme_fc_complete_rq() it is called before nvme_fc_unmap_data() in nvme_fc_start_fcp_op() afterwards. Even if this is a correct behaviour (i.e. doesn't harm as we're not touching req->special_vec.bv_page in nvme_fc_unmap_data() it at a first sight looks like an error. Care to adjust it?
Byte,
Johannes
Signature · 6 lines
Johannes Thumshirn Storage jthumshirn at suse.de +49 911 74053 689 SUSE LINUX GmbH, Maxfeldstr. 5, 90409 N?rnberg GF: Felix Imend?rffer, Jane Smithard, Graham Norton HRB 21284 (AG N?rnberg) Key fingerprint = EC38 9CAB C2C4 F25D 8600 D0D0 0393 969D 2D76 0850