From 3be3aeb9546580fe89709c1b407d32b82f5ec28f Mon Sep 17 00:00:00 2001 From: Jens Axboe Date: Wed, 27 Mar 2019 17:40:05 +0800 Subject: [PATCH] scsi: sg: remove bad blk_end_request_all() call mainline inclusion from mainline-4.20-rc1 commit abaf75dd610ccfe1d085cb17061ac8862aabd2ea category: bugfix bugzilla: 10016 CVE: NA --------------------------- We just need to free the request here. Additionally, this is currently wrong for a queue that's using MQ currently, it'll crash. Cc: Doug Gilbert Cc: linux-scsi@vger.kernel.org Signed-off-by: Jens Axboe Acked-by: Douglas Gilbert Signed-off-by: Martin K. Petersen Signed-off-by: zhengbin Reviewed-by: Jason Yan Signed-off-by: Yang Yingliang --- drivers/scsi/sg.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/scsi/sg.c b/drivers/scsi/sg.c index f66847d1e225..c75324a8dd94 100644 --- a/drivers/scsi/sg.c +++ b/drivers/scsi/sg.c @@ -822,7 +822,7 @@ sg_common_write(Sg_fd * sfp, Sg_request * srp, if (atomic_read(&sdp->detaching)) { if (srp->bio) { scsi_req_free_cmd(scsi_req(srp->rq)); - blk_end_request_all(srp->rq, BLK_STS_IOERR); + blk_put_request(srp->rq); srp->rq = NULL; } -- GitLab