gpu: nova-core: firmware: fwsec: use KVVec::zeroed() to zero-pad buffer
Subsystems (4)
PATCH v3 1/1 gpu: nova-core: firmware: fwsec: use KVVec::zeroed() to zero-pad buffer
Use KVVec::zeroed() to initialize the firmware object's leading zero padding.
---
Changes in v3:
- Drop the hunk that could panic for now (Alexandre)
- v2: https://lore.kernel.org/r/[email protected]/
Changes in v2:
- Add a // PANIC comment to copy_from_slice() (Danilo)
- v1: https://lore.kernel.org/r/[email protected]/
--- drivers/gpu/nova-core/firmware/fwsec/bootloader.rs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/gpu/nova-core/firmware/fwsec/bootloader.rs +1 -2
@@ -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 )?; (
Quoted 4 lines · Thorsten Blum
Use
KVVec::zeroed()to initialize the firmware object's leading zero padding.Signed-off-by Thorsten Blum <[email protected]>
Quoted 1 line · Thorsten Blum
[PATCH v3] gpu: nova-core: firmware: fwsec: use
KVVec::zeroed()to zero-pad buffer
Applied, thanks!
Branch: drm-rust-next
Tree: https://gitlab.freedesktop.org/drm/rust/kernel.git
[1/1] gpu: nova-core: firmware: fwsec: use KVVec::zeroed() to zero-pad buffer
commit: 5a1b7121a6c4
The patch will appear in the next linux-next integration (typically within 24 hours on weekdays).
The patch is queued up for the upcoming merge window for the next major kernel release.