Re: [PATCH] gpu: nova-core: firmware: fwsec: use zeroed() to zero-pad buffers

From: Danilo Krummrich

Date: Tue Oct 06 2026 - 18:21:05 EST


On Tue Oct 6, 2026 at 12:04 PM CEST, Thorsten Blum wrote:
> - let mut ucode = KVec::with_capacity(aligned_code_size, GFP_KERNEL)?;
> - ucode.extend_from_slice(code, GFP_KERNEL)?;
> - ucode.resize(aligned_code_size, 0, GFP_KERNEL)?;
> -
> + let mut ucode = KVec::zeroed(aligned_code_size, GFP_KERNEL)?;
> + ucode[..code.len()].copy_from_slice(code);

I kinda dislike that this is now a potential panic, but it does better express
the intent.

Can you please add a corresponding // PANIC comment?

Thanks,
Danilo