summaryrefslogtreecommitdiff
path: root/block/bsg-lib.c
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2017-09-07 14:54:35 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2017-10-05 10:47:31 +0300
commit0ea30c797c6f6f2e1606ab8960387a88e68f6fe4 (patch)
treebb132609d3b296a857a362585621e2cf450900c6 /block/bsg-lib.c
parentf148de59e2c6ce65bfca18312844d090c1fc9f8b (diff)
downloadlinux-0ea30c797c6f6f2e1606ab8960387a88e68f6fe4.tar.xz
bsg-lib: don't free job in bsg_prepare_job
commit f507b54dccfd8000c517d740bc45f20c74532d18 upstream. 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 <hch@lst.de> Reviewed-by: Ming Lei <ming.lei@redhat.com> Signed-off-by: Jens Axboe <axboe@kernel.dk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'block/bsg-lib.c')
-rw-r--r--block/bsg-lib.c1
1 files changed, 0 insertions, 1 deletions
diff --git a/block/bsg-lib.c b/block/bsg-lib.c
index dd56d7460cb9..c587c71d78af 100644
--- a/block/bsg-lib.c
+++ b/block/bsg-lib.c
@@ -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;
}