diff options
| author | yang.zhang <[email protected]> | 2024-02-01 10:01:26 +0800 |
|---|---|---|
| committer | Anup Patel <[email protected]> | 2024-02-20 16:24:06 +0530 |
| commit | 88273fe19e97e76aa2645add370324840dc7222a (patch) | |
| tree | 5f279b14ce3dc973f560f0b7bb5bb6ed7e302581 /include | |
| parent | 46c8c6582db1186ed8d474ff59df428e0e6dd89b (diff) | |
lib: sbi_pmu: Before using we should ensure PMU init done
If trap earlier before sbi_pmu_init done, some path would call
sbi_pmu_ctr_incr_fw, then it would go wrong:
1. if phs_ptr_offset is zero, then it get a wrong pmu state ptr
2. if phs_ptr_offset is ok, but we didn't call pmu_set_hart_state_ptr
it would be NULL POINT
Of course, the above situation will not occur at present, but it is
reasonable to check before using.
Signed-off-by: yang.zhang <[email protected]>
Reviewed-by: Anup Patel <[email protected]>
Diffstat (limited to 'include')
0 files changed, 0 insertions, 0 deletions
