diff options
| author | Paul Walmsley <pjw@kernel.org> | 2025-10-18 00:31:11 -0600 | 
|---|---|---|
| committer | Paul Walmsley <pjw@kernel.org> | 2025-10-18 09:36:11 -0600 | 
| commit | 2dc99ea2727640b2fe12f9aa0e38ea2fc3cbb92d (patch) | |
| tree | 9e379ac7dc198667f48d9ee522e136fe4375a1cd /drivers/gpu/drm/amd/amdgpu/amdgpu_virt.c | |
| parent | 5d15d2ad36b0f7afab83ca9fc8a2a6e60cbe54c4 (diff) | |
riscv: cpufeature: avoid uninitialized variable in has_thead_homogeneous_vlenb()
In has_thead_homogeneous_vlenb(), smatch detected that the vlenb variable
could be used while uninitialized.  It appears that this could happen if
no CPUs described in DT have the "thead,vlenb" property.
Fix by initializing vlenb to 0, which will keep thead_vlenb_of set to 0
(as it was statically initialized).  This in turn will cause
riscv_v_setup_vsize() to fall back to CSR probing - the desired result if
thead,vlenb isn't provided in the DT data.
While here, fix a nearby comment typo.
Cc: stable@vger.kernel.org
Cc: Charlie Jenkins <charlie@rivosinc.com>
Fixes: 377be47f90e41 ("riscv: vector: Use vlenb from DT for thead")
Signed-off-by: Paul Walmsley <pjw@kernel.org>
Link: https://lore.kernel.org/r/22674afb-2fe8-2a83-1818-4c37bd554579@kernel.org
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_virt.c')
0 files changed, 0 insertions, 0 deletions
