diff options
author | Gustavo A. R. Silva <[email protected]> | 2023-06-07 22:12:11 -0600 |
---|---|---|
committer | Tony Lindgren <[email protected]> | 2023-06-14 11:11:17 +0300 |
commit | 847fb80cc01a54bc827b02547bb8743bdb59ddab (patch) | |
tree | 5a274ed2474d4d5c3599592ed85d7fa89578d341 /net/lapb/lapb_in.c | |
parent | c63f5b454885b191483cb67a43892f92ec99eca2 (diff) |
ARM: OMAP2+: Fix -Warray-bounds warning in _pwrdm_state_switch()
If function pwrdm_read_prev_pwrst() returns -EINVAL, we will end
up accessing array pwrdm->state_counter through negative index
-22. This is wrong and the compiler is legitimately warning us
about this potential problem.
Fix this by sanity checking the value stored in variable _prev_
before accessing array pwrdm->state_counter.
Address the following -Warray-bounds warning:
arch/arm/mach-omap2/powerdomain.c:178:45: warning: array subscript -22 is below array bounds of 'unsigned int[4]' [-Warray-bounds]
Link: https://github.com/KSPP/linux/issues/307
Fixes: ba20bb126940 ("OMAP: PM counter infrastructure.")
Cc: [email protected]
Reported-by: kernel test robot <[email protected]>
Link: https://lore.kernel.org/lkml/20230607050639.LzbPn%[email protected]/
Signed-off-by: Gustavo A. R. Silva <[email protected]>
Message-ID: <ZIFVGwImU3kpaGeH@work>
Acked-by: Ard Biesheuvel <[email protected]>
Signed-off-by: Tony Lindgren <[email protected]>
Diffstat (limited to 'net/lapb/lapb_in.c')
0 files changed, 0 insertions, 0 deletions