From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id B1B52CDB474 for ; Tue, 17 Oct 2023 06:09:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234511AbjJQGJP (ORCPT ); Tue, 17 Oct 2023 02:09:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59728 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230343AbjJQGJN (ORCPT ); Tue, 17 Oct 2023 02:09:13 -0400 Received: from verein.lst.de (verein.lst.de [213.95.11.211]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C76D3B0 for ; Mon, 16 Oct 2023 23:09:12 -0700 (PDT) Received: by verein.lst.de (Postfix, from userid 2407) id 74C5868BFE; Tue, 17 Oct 2023 08:09:08 +0200 (CEST) Date: Tue, 17 Oct 2023 08:09:08 +0200 From: Christoph Hellwig To: Mark O'Donovan 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 Subject: Re: [PATCH v3 1/3] nvme-auth: alloc nvme_dhchap_key as single buffer Message-ID: <20231017060908.GA8454@lst.de> References: <20231016225857.3085234-1-shiftee@posteo.net> <20231016225857.3085234-2-shiftee@posteo.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20231016225857.3085234-2-shiftee@posteo.net> User-Agent: Mutt/1.5.17 (2007-11-01) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > +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.