OSDN Git Service

bsg-lib: don't free job in bsg_prepare_job
authorChristoph Hellwig <hch@lst.de>
Thu, 7 Sep 2017 11:54:35 +0000 (13:54 +0200)
committerJens Axboe <axboe@kernel.dk>
Mon, 25 Sep 2017 14:56:05 +0000 (08:56 -0600)
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>
Cc: stable@vger.kernel.org
Reviewed-by: Ming Lei <ming.lei@redhat.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
block/bsg-lib.c

index c82408c..dbddff8 100644 (file)
@@ -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;
 }