Skip to content

Commit e5d574a

Browse files
Chunguang Xukeithbusch
authored andcommitted
nvme: avoid double free special payload
If a discard request needs to be retried, and that retry may fail before a new special payload is added, a double free will result. Clear the RQF_SPECIAL_LOAD when the request is cleaned. Signed-off-by: Chunguang Xu <[email protected]> Reviewed-by: Sagi Grimberg <[email protected]> Reviewed-by: Max Gurtovoy <[email protected]> Signed-off-by: Keith Busch <[email protected]>
1 parent b1a1fdd commit e5d574a

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

drivers/nvme/host/core.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -998,6 +998,7 @@ void nvme_cleanup_cmd(struct request *req)
998998
clear_bit_unlock(0, &ctrl->discard_page_busy);
999999
else
10001000
kfree(bvec_virt(&req->special_vec));
1001+
req->rq_flags &= ~RQF_SPECIAL_PAYLOAD;
10011002
}
10021003
}
10031004
EXPORT_SYMBOL_GPL(nvme_cleanup_cmd);

0 commit comments

Comments
 (0)