]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/commitdiff
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)
committerSeth Forshee <seth.forshee@canonical.com>
Thu, 12 Oct 2017 21:20:34 +0000 (16:20 -0500)
BugLink: http://bugs.launchpad.net/bugs/1721777
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>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
block/bsg-lib.c

index dd56d7460cb91d504aa22ae9215d00f97c844359..c587c71d78afbe136c74e91597fa1a1a3fb97496 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;
 }