All of lore.kernel.org
 help / color / mirror / Atom feed
From: kbusch@kernel.org (Keith Busch)
Subject: [PATCH] nvmet: Fix discover log page when offsets are used
Date: Mon, 8 Apr 2019 13:46:09 -0600	[thread overview]
Message-ID: <20190408194609.GC32613@localhost.localdomain> (raw)
In-Reply-To: <20190408192932.563-1-keith.busch@intel.com>

On Mon, Apr 08, 2019@01:29:32PM -0600, Keith Busch wrote:
> @@ -149,36 +168,33 @@ static void nvmet_execute_get_disc_log_page(struct nvmet_req *req)
>  	 * If host provided data len is less than the header size, only the
>  	 * number of bytes requested by host will be sent to host.
>  	 */
> -	hdr = kzalloc(alloc_len, GFP_KERNEL);
> -	if (!hdr) {
> +	down_read(&nvmet_config_sem);
> +	alloc_len = sizeof(*hdr) + entry_size * discovery_log_entries(req);
> +	buffer = kzalloc(alloc_len, GFP_KERNEL);
> +	if (!buffer) {
>  		status = NVME_SC_INTERNAL;
>  		goto out;
>  	}

There's an error here not unlocking the target control rw-semaphore on
allocation failure. Going to send a v2 in 5 seconds, so please disregard
this one.

  reply	other threads:[~2019-04-08 19:46 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-08 19:29 [PATCH] nvmet: Fix discover log page when offsets are used Keith Busch
2019-04-08 19:46 ` Keith Busch [this message]
2019-04-08 21:57 ` James Smart
2019-04-08 22:51   ` James Smart

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=20190408194609.GC32613@localhost.localdomain \
    --to=kbusch@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.