[PATCH v3] gpu: nova-core: firmware: fwsec: use KVVec::zeroed() to zero-pad buffer

From: Thorsten Blum

Date: Wed Oct 07 2026 - 16:32:13 EST


Use KVVec::zeroed() to initialize the firmware object's leading zero
padding.

Signed-off-by: Thorsten Blum <blum@xxxxxxxxxx>
---
Changes in v3:
- Drop the hunk that could panic for now (Alexandre)
- v2: https://lore.kernel.org/r/20261007080708.124563-2-blum@xxxxxxxxxx/

Changes in v2:
- Add a // PANIC comment to copy_from_slice() (Danilo)
- v1: https://lore.kernel.org/r/20261006100442.80432-3-blum@xxxxxxxxxx/
---
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)?;

(