two small bsg fixes, take 3
Subsystems (3)
Now fully away, with my fair share of coffee and lunch:
Two fixups for the recent bsg-lib fixes, should go into 4.13 stable as well.
PATCH 1/2 bsg-lib: don't free job in bsg_prepare_job
The job structure is allocated as part of the request, so we should not free it in the error path of bsg_prepare_job.
--- block/bsg-lib.c | 1 - 1 file changed, 1 deletion(-)
block/bsg-lib.c +0 -1
@@ -154,7 +154,6 @@ static int bsg_prepare_job(struct device *dev, struct request *req) failjob_rls_rqst_payload:kfree (job->request_payload.sg_list); failjob_rls_job: -kfree (job);return -ENOMEM ; }
Signature · 1 line
2.11.0
Re: [PATCH 1/2] bsg-lib: don't free job in bsg_prepare_job
Quoted 24 lines · Christoph Hellwig
The job structure is allocated as part of the request, so we should not free it in the error path of
bsg_prepare_job.Signed-off-by Christoph Hellwig <[email protected]>--- block/bsg-lib.c | 1 - 1 file changed, 1 deletion(-)block/bsg-lib.c +0
-1@@ -154,7 +154,6 @@ static int bsg_prepare_job(struct device *dev, struct request *req) failjob_rls_rqst_payload:kfree (job->request_payload.sg_list); failjob_rls_job: -kfree (job);return -ENOMEM ; }Signature · 1 line
2.11.0
Signature · 1 line
Ming
Jens Axboe
maintainerRe: [PATCH 1/2] bsg-lib: don't free job in bsg_prepare_job
In reply to Christoph HellwigQuoted 2 lines · Christoph Hellwig
The job structure is allocated as part of the request, so we should not free it in the error path of
bsg_prepare_job.
Added for this series, thanks.
Signature · 1 line
Jens Axboe
PATCH 2/2 scsi_transport_fc: fix NULL pointer dereference in fc_bsg_job_timeout
In reply to Christoph Hellwigbsg-lib now embeddeds the job structure into the request, and req->special can't be used anymore.
--- drivers/scsi/scsi_transport_fc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/scsi/scsi_transport_fc.c +1 -1
@@ -3550,7 +3550,7 @@ fc_vport_sched_delete(struct work_struct *work)static enum blk_eh_timer_return fc_bsg_job_timeout (struct request *req) { -struct bsg_job *job = (void *) req->special; +struct bsg_job *job =blk_mq_rq_to_pdu (req);struct Scsi_Host *shost =fc_bsg_to_shost (job);struct fc_rport *rport =fc_bsg_to_rport (job);struct fc_internal *i =to_fc_internal (shost->transportt);
Signature · 1 line
2.11.0
Re: [PATCH 2/2] scsi_transport_fc: fix NULL pointer dereference in fc_bsg_job_timeout
Quoted 25 lines · Christoph Hellwig
bsg-lib now embeddeds the job structure into the request, and
req->specialcan't be used anymore.Signed-off-by Christoph Hellwig <[email protected]>--- drivers/scsi/scsi_transport_fc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/scsi/scsi_transport_fc.c +1
-1@@ -3550,7 +3550,7 @@ fc_vport_sched_delete(struct work_struct *work)static enum blk_eh_timer_return fc_bsg_job_timeout (struct request *req) { -struct bsg_job *job = (void *) req->special; +struct bsg_job *job =blk_mq_rq_to_pdu (req);struct Scsi_Host *shost =fc_bsg_to_shost (job);struct fc_rport *rport =fc_bsg_to_rport (job);struct fc_internal *i =to_fc_internal (shost->transportt);Signature · 1 line
2.11.0
Signature · 1 line
Ming
Martin K. Petersen
AppliedRe: [PATCH 2/2] scsi_transport_fc: fix NULL pointer dereference in fc_bsg_job_timeout
In reply to Christoph HellwigChristoph,
Quoted 2 lines
bsg-lib now embeddeds the job structure into the request, and
req->specialcan't be used anymore.
Applied to 4.14/scsi-fixes.
Signature · 1 line
Martin K. Petersen Oracle Linux Engineering
Quoted 5 lines · Christoph Hellwig
Now fully away, with my fair share of coffee and lunch:
Two fixups for the recent bsg-lib fixes, should go into 4.13 stable as well.
Jens, can you look at this for Linux 4.14?