mirror of
https://github.com/torvalds/linux.git
synced 2026-11-28 17:32:32 +00:00
Dan has reported two uses of uninitialized variables in __ris_msmon_read(). If an unknown monitor type is encountered then the local variable, now, is used uninitialized. Fix this by returning early on error. If a non-mbwu monitor is being read then the local variable, overflow, is not initialized but still read. Initialize it to false as overflow is not relevant for csu monitors. Fixes:823e7c3712("arm_mpam: Add mpam_msmon_read() to read monitor value") Fixes:9e5afb7c32("arm_mpam: Use long MBWU counters if supported") Reported-by: kernel test robot <[email protected]> Reported-by: Dan Carpenter <[email protected]> Closes: https://lore.kernel.org/r/[email protected]/ Closes: https://lore.kernel.org/r/[email protected]/ Signed-off-by: Ben Horgan <[email protected]> Reviewed-by: Jonathan Cameron <[email protected]> Signed-off-by: Catalin Marinas <[email protected]>