From: Eliot Courtney Date: Mon, 25 May 2026 13:57:19 +0000 (+0900) Subject: gpu: nova-core: vbios: stop scanning at BIOS_MAX_SCAN_LEN X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fc7c1054b6f983ae2f3e100a24cc87908ae9f4b7;p=thirdparty%2Fkernel%2Flinux.git gpu: nova-core: vbios: stop scanning at BIOS_MAX_SCAN_LEN Current code lets `current_offset` go to `BIOS_MAX_SCAN_LEN` which is one byte too far. Fixes: 6fda04e7f0cd ("gpu: nova-core: vbios: Add base support for VBIOS construction and iteration") Reviewed-by: Joel Fernandes Reviewed-by: John Hubbard Signed-off-by: Eliot Courtney Link: https://patch.msgid.link/20260525-fix-vbios-v5-1-e5e455251537@nvidia.com Signed-off-by: Danilo Krummrich --- diff --git a/drivers/gpu/nova-core/vbios.rs b/drivers/gpu/nova-core/vbios.rs index 6bcfb6c5cf447..7bec81a373406 100644 --- a/drivers/gpu/nova-core/vbios.rs +++ b/drivers/gpu/nova-core/vbios.rs @@ -272,7 +272,7 @@ impl<'a> Iterator for VbiosIterator<'a> { return None; } - if self.current_offset > BIOS_MAX_SCAN_LEN { + if self.current_offset >= BIOS_MAX_SCAN_LEN { dev_err!(self.dev, "Error: exceeded BIOS scan limit, stopping scan\n"); return None; }