RISC-V: Avoid dereferening NULL regs in die()
stable inclusion from stable-v5.10.175 commit f9fdb3e7b0758516fbc5ae12e3ec23d9060f7035 category: bugfix bugzilla: https://gitee.com/openeuler/kernel/issues/I8711T Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=f9fdb3e7b0758516fbc5ae12e3ec23d9060f7035 -------------------------------- [ Upstream commit f2913d00 ] I don't think we can actually die() without a regs pointer, but the compiler was warning about a NULL check after a dereference. It seems prudent to just avoid the possibly-NULL dereference, given that when die()ing the system is already toast so who knows how we got there. Reported-by:kernel test robot <lkp@intel.com> Reported-by:
Dan Carpenter <dan.carpenter@oracle.com> Reviewed-by:
Conor Dooley <conor.dooley@microchip.com> Link: https://lore.kernel.org/r/20220920200037.6727-1-palmer@rivosinc.com Signed-off-by:
Palmer Dabbelt <palmer@rivosinc.com> Stable-dep-of: 130aee3f ("riscv: Avoid enabling interrupts in die()") Signed-off-by:
Sasha Levin <sashal@kernel.org> Signed-off-by:
sanglipeng <sanglipeng1@jd.com>
Loading
Please sign in to comment