From: Christoph Hellwig Date: Thu, 7 Sep 2017 11:54:35 +0000 (+0200) Subject: bsg-lib: don't free job in bsg_prepare_job X-Git-Tag: v4.13.5~45 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=0ea30c797c6f6f2e1606ab8960387a88e68f6fe4;p=users%2Fdwmw2%2Flinux.git 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 Reviewed-by: Ming Lei Signed-off-by: Jens Axboe Signed-off-by: Greg Kroah-Hartman --- diff --git a/block/bsg-lib.c b/block/bsg-lib.c index dd56d7460cb91..c587c71d78afb 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; }