[PATCH 5.11 062/120] RISC-V: Fix out-of-bounds accesses in init_resources()