Resolve this smatch warning:
arch/riscv/kernel/sys_hwprobe.c:50 hwprobe_arch_id() error: uninitialized symbol 'cpu_id'.
This could happen if hwprobe_arch_id() was called with a key ID of
something other than MVENDORID, MIMPID, and MARCHID. This does not
happen in the current codebase. The only caller of hwprobe_arch_id()
is a function that only passes one of those three key IDs.
For the sake of reducing static analyzer warning noise, and in the
unlikely event that hwprobe_arch_id() is someday called with some
other key ID, validate hwprobe_arch_id()'s input to ensure that
'cpu_id' is always initialized before use.
Fixes:
|
||
|---|---|---|
| .. | ||
| boot | ||
| configs | ||
| crypto | ||
| errata | ||
| include | ||
| kernel | ||
| kvm | ||
| lib | ||
| mm | ||
| net | ||
| purgatory | ||
| tools | ||
| Kbuild | ||
| Kconfig | ||
| Kconfig.debug | ||
| Kconfig.errata | ||
| Kconfig.socs | ||
| Kconfig.vendor | ||
| Makefile | ||
| Makefile.postlink | ||