mirror of
https://github.com/riscv-software-src/opensbi.git
synced 2026-09-08 18:21:29 +01:00
lib: sbi: dbtr: return SBI_ERR_BAD_RANGE for invalid trigger index range
sbi_dbtr_read_trig() returns SBI_ERR_INVALID_PARAM for an out-of-range
trigger index range, where SBI v3.0 section 19.3 defines
SBI_ERR_BAD_RANGE. Return SBI_ERR_BAD_RANGE, matching the equivalent
range check in sbi_dbtr_update_trig().
Fixes: 324021423d ("lib: sbi: dbtr: Fix update_triggers to match SBI")
Signed-off-by: David E. Garcia Porras <david.garcia@aheadcomputing.com>
Reviewed-by: Anup Patel <anup@brainfault.org>
Link: https://lore.kernel.org/r/20260727183041.258377-3-david.garcia@aheadcomputing.com
Signed-off-by: Anup Patel <anup@brainfault.org>
This commit is contained in:
committed by
Anup Patel
parent
f95648d395
commit
3e21ee3496
+1
-1
@@ -573,7 +573,7 @@ int sbi_dbtr_read_trig(unsigned long smode,
|
|||||||
|
|
||||||
if (trig_idx_base >= hs->total_trigs ||
|
if (trig_idx_base >= hs->total_trigs ||
|
||||||
trig_idx_base + trig_count >= hs->total_trigs)
|
trig_idx_base + trig_count >= hs->total_trigs)
|
||||||
return SBI_ERR_INVALID_PARAM;
|
return SBI_ERR_BAD_RANGE;
|
||||||
|
|
||||||
if (sbi_dbtr_shmem_disabled(hs))
|
if (sbi_dbtr_shmem_disabled(hs))
|
||||||
return SBI_ERR_NO_SHMEM;
|
return SBI_ERR_NO_SHMEM;
|
||||||
|
|||||||
Reference in New Issue
Block a user