From: Ming Lei <ming.lei@redhat.com>
To: Christoph Hellwig <hch@lst.de>
Cc: axboe@kernel.dk, linux-block@vger.kernel.org,
linux-scsi@vger.kernel.org, stable@vger.kernel.org
Subject: Re: [PATCH 1/2] bsg-lib: don't free job in bsg_prepare_job
Date: Fri, 8 Sep 2017 09:28:52 +0800 [thread overview]
Message-ID: <20170908012851.GB3802@ming.t460p> (raw)
In-Reply-To: <20170907115436.5069-2-hch@lst.de>
On Thu, Sep 07, 2017 at 01:54:35PM +0200, Christoph Hellwig wrote:
> 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
> ---
> block/bsg-lib.c | 1 -
> 1 file changed, 1 deletion(-)
>
> 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;
> }
>
> --
> 2.11.0
>
Reviewed-by: Ming Lei <ming.lei@redhat.com>
--
Ming
next prev parent reply other threads:[~2017-09-08 1:28 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-09-07 11:54 two small bsg fixes, take 3 Christoph Hellwig
2017-09-07 11:54 ` [PATCH 1/2] bsg-lib: don't free job in bsg_prepare_job Christoph Hellwig
2017-09-08 1:28 ` Ming Lei [this message]
2017-09-15 4:31 ` Jens Axboe
2017-09-07 11:54 ` [PATCH 2/2] scsi_transport_fc: fix NULL pointer dereference in fc_bsg_job_timeout Christoph Hellwig
2017-09-08 1:29 ` Ming Lei
2017-09-15 0:40 ` Martin K. Petersen
2017-09-14 23:05 ` two small bsg fixes, take 3 Christoph Hellwig
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20170908012851.GB3802@ming.t460p \
--to=ming.lei@redhat.com \
--cc=axboe@kernel.dk \
--cc=hch@lst.de \
--cc=linux-block@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
--cc=stable@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox