nvme: avoid double free special payload
PATCH 1/1 nvme: avoid double free special payload
From: Chunguang Xu <[email protected]>
commit e5d574ab37f5f2e7937405613d9b1a724811e5ad upstream.
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]>
Signed-off-by Dmitriy Privalov <[email protected]>
--- drivers/nvme/host/core.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/nvme/host/core.c +1 -0
@@ -852,6 +852,7 @@ void nvme_cleanup_cmd(struct request *req)clear_bit_unlock (0 , &ns->ctrl->discard_page_busy); else kfree(page_address(page) + req->special_vec.bv_offset); + req->rq_flags &= ~RQF_SPECIAL_PAYLOAD ; } }EXPORT_SYMBOL_GPL (nvme_cleanup_cmd);
Signature · 1 line
2.34.1