public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@lst.de>
To: Mark O'Donovan <shiftee@posteo.net>
Cc: linux-kernel@vger.kernel.org, linux-nvme@lists.infradead.org,
	sagi@grimberg.me, hch@lst.de, axboe@kernel.dk, kbusch@kernel.org,
	hare@suse.de, Akash Appaiah <Akash.Appaiah@dell.com>
Subject: Re: [PATCH v3 1/3] nvme-auth: alloc nvme_dhchap_key as single buffer
Date: Tue, 17 Oct 2023 08:09:08 +0200	[thread overview]
Message-ID: <20231017060908.GA8454@lst.de> (raw)
In-Reply-To: <20231016225857.3085234-2-shiftee@posteo.net>

> +struct nvme_dhchap_key *nvme_auth_alloc_key(u32 len, u8 hash)
> +{
> +	struct nvme_dhchap_key *key = kzalloc(len + sizeof(*key), GFP_KERNEL);

This should use the struct_size() helper:

	key = kzalloc(struct_size(key, key, len), GFP_KERNEL);

Otherwise the change looks good.

  parent reply	other threads:[~2023-10-17  6:09 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-16 22:58 [PATCH v3 0/3] Remove secret-size restrictions for hashes Mark O'Donovan
2023-10-16 22:58 ` [PATCH v3 1/3] nvme-auth: alloc nvme_dhchap_key as single buffer Mark O'Donovan
2023-10-17  6:05   ` Hannes Reinecke
2023-10-17  6:09   ` Christoph Hellwig [this message]
2023-10-16 22:58 ` [PATCH v3 2/3] nvme-auth: use transformed key size to create resp Mark O'Donovan
2023-10-17  6:06   ` Hannes Reinecke
2023-10-17  6:12   ` Christoph Hellwig
2023-10-16 22:58 ` [PATCH v3 3/3] nvme-auth: allow mixing of secret and hash lengths Mark O'Donovan

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=20231017060908.GA8454@lst.de \
    --to=hch@lst.de \
    --cc=Akash.Appaiah@dell.com \
    --cc=axboe@kernel.dk \
    --cc=hare@suse.de \
    --cc=kbusch@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-nvme@lists.infradead.org \
    --cc=sagi@grimberg.me \
    --cc=shiftee@posteo.net \
    /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