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 gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 12712CA6002 for ; Wed, 7 Oct 2026 20:31:38 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 4FEA910E6A0; Wed, 7 Oct 2026 20:31:38 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=kernel.org header.i=@kernel.org header.b="h3eQmIAX"; dkim-atps=neutral Received: from sea.source.kernel.org (sea.source.kernel.org [172.234.252.31]) by gabe.freedesktop.org (Postfix) with ESMTPS id 3FD3D10E6A0 for ; Wed, 7 Oct 2026 20:31:37 +0000 (UTC) Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) by sea.source.kernel.org (Postfix) with ESMTP id E508B43849; Wed, 7 Oct 2026 20:31:36 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 08F231F000FF; Wed, 7 Oct 2026 20:31:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1791405096; bh=qojxThXJYnvOU2hZpJJBuTXsweww2zb+UtRFzWYglJ0=; h=From:To:Cc:Subject:Date; b=h3eQmIAXESzouTrZ81ueiSiZoMKSoIMHjDQzIJO/vqVIpgYIbcpe1eSDrBDA92qXj kMPQ0vLQdyD71ulktOs4bqkfnWeOeLljS6dyBBB4h7uplnqla6s6i5byQklTG0lZ8H j4gUsxCWfL/pPspNRZaXQpqkHBeivxQ+eoaXHpJQ7rg8219o6SXYyZq5D0+FrAnTfQ JOs6WBKma12CmmVUdpbCRdBRRh+IC3/aOevvl/v0pGH80d+yZJ6SkekS4Z2DrqNJlB hI2H4+Qf02TuuJvNFgDy2ZtTGGf4ojlAK/EX2FWNv9fXZmysjy1fnF+J/yx7VJTYn+ 4brNQIN9zHaJw== From: Thorsten Blum To: Danilo Krummrich , Alexandre Courbot , Alice Ryhl , David Airlie , Simona Vetter , Gary Guo , Timur Tabi , Tim Kovalenko Cc: Thorsten Blum , Eliot Courtney , nova-gpu@lists.linux.dev, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Subject: [PATCH v3] gpu: nova-core: firmware: fwsec: use KVVec::zeroed() to zero-pad buffer Date: Wed, 7 Oct 2026 22:30:29 +0200 Message-ID: <20261007203035.162075-4-blum@kernel.org> X-Mailer: git-send-email 2.55.0 MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1230; i=blum@kernel.org; h=from:subject; bh=HTFw+9IG+V7FoK8E2jpa6clxuJyqvReEoNTSCovpnH8=; b=owGbwMvMwCUWt7pQ4caZUj3G02pJDFnHVr82eLyhq+NKfjpjQ4XEpPSvXXub07Qufdz45/qUh rd3ru/n6ShlYRDjYpAVU2R5MOvHDN/SmspNJhE7YeawMoEMYeDiFICJGNgyMuwofMh3a57NnUVX XU60XOovOK5ilXuwVnW2/OXLxyRncIUw/Ga7P82ENYI1qOYai2UDS3LWzvUsN/hs1+nM++56M+n IIk4A X-Developer-Key: i=blum@kernel.org; a=openpgp; fpr=1D60735E8AEF3BE473B69D84733678FD8DFEEAD4 Content-Transfer-Encoding: 8bit X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Use KVVec::zeroed() to initialize the firmware object's leading zero padding. Signed-off-by: Thorsten Blum --- Changes in v3: - Drop the hunk that could panic for now (Alexandre) - v2: https://lore.kernel.org/r/20261007080708.124563-2-blum@kernel.org/ Changes in v2: - Add a // PANIC comment to copy_from_slice() (Danilo) - v1: https://lore.kernel.org/r/20261006100442.80432-3-blum@kernel.org/ --- drivers/gpu/nova-core/firmware/fwsec/bootloader.rs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/gpu/nova-core/firmware/fwsec/bootloader.rs b/drivers/gpu/nova-core/firmware/fwsec/bootloader.rs index ec4d92317a93..c487dd9eba82 100644 --- a/drivers/gpu/nova-core/firmware/fwsec/bootloader.rs +++ b/drivers/gpu/nova-core/firmware/fwsec/bootloader.rs @@ -162,8 +162,7 @@ pub(crate) fn new( .ok_or(EOVERFLOW)? }; - let mut firmware_obj = KVVec::new(); - firmware_obj.extend_with(align_padding, 0u8, GFP_KERNEL)?; + let mut firmware_obj = KVVec::zeroed(align_padding, GFP_KERNEL)?; firmware_obj.extend_from_slice(firmware.ucode.0.as_slice(), GFP_KERNEL)?; (