mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH v3] gpu: nova-core: firmware: fwsec: use KVVec::zeroed() to zero-pad buffer
@ 2026-10-07 20:30 Thorsten Blum
  0 siblings, 0 replies; only message in thread
From: Thorsten Blum @ 2026-10-07 20:30 UTC (permalink / raw)
  To: Danilo Krummrich, Alexandre Courbot, Alice Ryhl, David Airlie,
	Simona Vetter, Gary Guo, Timur Tabi, Tim Kovalenko
  Cc: Thorsten Blum, Eliot Courtney, nova-gpu, dri-devel, linux-kernel

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

Signed-off-by: Thorsten Blum <blum@kernel.org>
---
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)?;
 
             (

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2026-10-07 20:31 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-10-07 20:30 [PATCH v3] gpu: nova-core: firmware: fwsec: use KVVec::zeroed() to zero-pad buffer Thorsten Blum

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®