[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20231017060908.GA8454@lst.de>
Date: Tue, 17 Oct 2023 08:09:08 +0200
From: Christoph Hellwig <hch@....de>
To: Mark O'Donovan <shiftee@...teo.net>
Cc: linux-kernel@...r.kernel.org, linux-nvme@...ts.infradead.org,
sagi@...mberg.me, hch@....de, axboe@...nel.dk, kbusch@...nel.org,
hare@...e.de, Akash Appaiah <Akash.Appaiah@...l.com>
Subject: Re: [PATCH v3 1/3] nvme-auth: alloc nvme_dhchap_key as single
buffer
> +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.
Powered by blists - more mailing lists